Re: Features added to QuickForm

From: Date: Fri, 16 Nov 2001 22:44:54 +0000
Subject: Re: Features added to QuickForm
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-2938@lists.php.net to get a copy of this message
Jonas Delfs a écrit :
I'm using QuickForm to create HTML forms and found some missing features that I've now added: The functions setLabelAlign(), setLabelBold(), setHeaderBold(), setHeaderColor() and theese functions variables: $_labelAlign, $_labelBoldFlag, $_headerBoldFlag, $_headerColor I think their purposes talks for them selves, but they have ofcause been documented in QuickForm.php. Furthermore I've added a few parametres to addHeader() and _wrapHeader(): the optional $bgColor and $bold. This is to let the developer specify a specific background-color and/or boldness for a specific header. Theese arguments will also overwrite any standard settings set by setHeaderBold() and setHeaderColor(). In same process _buildHeader() has been build out to handle theese 2 settings. At last, I've found a little error in the documentation of addRule() regarding the $type argument. The new and better QuickForm.php is to be found on: http://delfs.dk/QuickForm.php
It is pretty pretentious to call it better I think !?! After all, all you have done is adding a few layout methods which are not in the class logic. To do what you want to do, the best way today is to override the _wrapXXX methods. Excuse me, but I believe it is quite stupid to add $bgColor or $bold to addHeader(), why not add $red, or $small, ... Maybe, instead of that, you should add a new $attributes parameter (converted by HTML_Common) which will pass your bgcolor stuff (or even the css class you want to use). (same goes for setHeaderBold and the rest). But that would suppose that headers are also objects. Then they could be created using the addElement method... Got to think about it... The real missing thing for now is the ability to parse form elements and to return them as an array (which could then be processed by the parser you want to use : ITX, Smarty, XML, HTML_Table...). If you could come up with a good idea on how to do this, that would be great !
I also have a few comments to the original developers of QuickForm: Why is HTML-kode in uppercase? -XHTML standards says in lowercase. Why not let the Table-class do the table-stuff? And at last, if i add a checkbox or radio element the label is both places before and after the element. The label only have to be shown after an element in an element group, I think.
Personally, I don't care about XHTML, but I can understand some people do. Do you think the validation javascript should be treated as containing #PCDATA ? Maybe some day Adam will modify his HTML_Common class to throw lowercase, but really, this is just a detail. Tell me why this is so important ? About your last point I don't get what you are talking about. Could you give an example please. Bertrand Mansion Mamasam

« previous php.pear.dev (#2938) next »