Re: QuickForm questions +suggestions
| From: | Bertrand Mansion | Date: | Tue, 06 Nov 2001 18:41:41 +0000 |
| Subject: | Re: QuickForm questions +suggestions | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-2586@lists.php.net to get a copy of this message | ||
Le mardi 6 novembre 2001, à 02:54 , Peter Bowyer a écrit :
I've just downloaded the QuickForm class and had a little play with it, and now have a few questions and suggestions. Is there any chance of (XML?) config files for each form, so that you just go: $form = new HTML_QuickForm('Test.conf'); as opposed to specifying the elements in the script?Right, this is a good idea. I don't think it would be that hard to implement. As always, just a matter of time.
Shouldn't the presentation be abstracted further from the QuickForm class? I would suggest returning an array of the elements and labels for the fields, and then using Table.php to create the table to hold the form. This would also allow people to assign the form elements to block templates/Smarty/etc more easily than at present.At the moment, some methods of the class are supposed to be overridden to achieve a certain level of customization. They are the ones beginning with _wrap... where you can wrap form elements, even the form itself. The idea to get everything in an array is good too. It could be a brother method for toHtml() called toArray() for example. Then, the work usually done by toHtml() would have to be done by the programmer. As always, it could be done, if someone finds the time...
I suggest this because I want to do something like the following with the form class. For years, I've believed that the best way to handle form errors is to display an error message, and highlight the area in question as well. I have spent a long time looking for a PHP script to do this, but not found any yet. I believe QuickForm may be the right one, and suggest this as a future addition.Yes, the class can do that. And by overridding _wrapElement method, you can make your own highlight style. These are good ideas anyway. Thanks Bertrand Mansion Mamasam