Simple form generator

Coding Critique is the place to post source code for peer review by other members of DevNetwork. Any kind of code can be posted. Code posted does not have to be limited to PHP. All members are invited to contribute constructive criticism with the goal of improving the code. Posted code should include some background information about it and what areas you specifically would like help with.

Popular code excerpts may be moved to "Code Snippets" by the moderators.

Moderator: General Moderators

User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Jenk wrote:That's got nothing to do with the code in my first post.. that's down to the implmentation and use of the code.. not the class(es).
YES!
Jenk wrote:The setProperty method is a lot cleaner and easier to read than

Code: Select all

$form->addElement('textarea', 'myTextarea', null, array('rows'=>2, 'cols'=>20));
volka wrote:
Jenk wrote:The setProperty method is a lot cleaner and easier to read than
For the static part of the form I disagree, but anyway...
volka wrote:
$form = new HTML_QuickForm('myForm');
$form->addElement('textarea', 'myTextarea', null, array('rows'=>2, 'cols'=>20));
$form->addElement('submit', null, 'click me!');
$form->display();
this is static. No matter what the rest of the script does the form always looks the same - there's no dynamic/changing part in it. And in this case I like a compact form of coding. It was not criticism, just a statement, a preference.
Now, will you please kindly forget about it?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Ok thanks, enough of that.
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

No need to repeat the entire exercise in misunderstanding one another, but I gather volka's point is along the lines of
William of Ockham wrote:entities should not be multiplied beyond necessity.
Point being: apart from better legibility (subjective), what does your form-generator offer that others, e.g. Quickform, don't?
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

Simplicity, more flexibility, and less bloat.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

QuickForm is probably over 300k of code, not all used at once. It does a lot. I would suggest taking a difference approach. I don't use QuickForm because I don't use that style.
(#10850)
Post Reply