RE: [PEAR-DEV] HTML_QuickForm
| From: | David Sklar | Date: | Fri, 22 Nov 2002 15:48:34 +0000 |
| Subject: | RE: [PEAR-DEV] HTML_QuickForm | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-11007@lists.php.net to get a copy of this message | ||
You can do this with the setElementTemplate() method, e.g.:
$form->setElementTemplate('<TR><TD>{label}:</TD><TD>{element}</TD></TR>');
Also check out the setHeaderTemplate() and setFormTemplate() methods and the
_headerTemplate, _elementTemplate, and _formTemplate variables in the
HTML_QuickForm class.
-dave
> -----Original Message-----
> From: Tony Bibbs [mailto:tony@tonybibbs.com]
> Sent: Friday, November 22, 2002 10:40 AM
> To: PEAR Development
> Subject: [PEAR-DEV] HTML_QuickForm
>
>
> Has there been any thought to allowing the HTML_QuickForm to
> allow the use
> of PEAR's HTML template system?
>
> What I am getting at is QuickForm appears to have 95% of what I
> want but I
> still want to allow people to control the layout of the form. For
> example, in the templates you'd have something like:
>
> <HTML>
> <BODY>
> <H2>My Form</H2>
> {form_start}
> <TABLE>
> <TR>
> <TD>{form_username_label}:</TD><TD>{form_username}</td>
> </TR>
> <TR>
> <TD>{form_password_label}:</TD><TD>{form_password}</td>
> </TR>
> </TABLE>
> {form_end}
>
> In this example, all the form_ variables would be set by
> QuickForm display
> method. I think this would be pretty easy, first you'd need one method
> called setOutputType($type) where $type would be some one of two
> constants, OUTPUT_DEFAULT or OUTPUT_TEMPLATE. OUTPUT_DEFAULT would cause
> QuickForm to work as it does today and OUTPUT_TEMPLATE would use the PEAR
> template method out outlined above.
>
> Thoughts?
>
> --Tony
>
>
> --
> PEAR Development Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php