Re: Quickform Renderer
| From: | Timothy Marsolais | Date: | Wed, 22 Feb 2006 19:55:11 +0000 |
| Subject: | Re: Quickform Renderer | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-23094@lists.php.net to get a copy of this message | ||
Hi Nicolas,
I have been using Quickform for a while, and I add this set of code to every one:
/* renderer information */
$renderer =& $oContactForm->defaultRenderer();
$renderer->setFormTemplate('<form {attributes}
class="large">{content}</form>');
$renderer->setElementTemplate('<div class="formQuestion"><span
class="bold">{label} <!-- BEGIN
required --><span class="required">*</span><!-- END required
--></span> {element}</div><!-- BEGIN
error --><div class="errorText">{error}</div><!-- END error
-->');
$renderer->setHeaderTemplate('<div
class="formHeader">{header}</div>');
$renderer->setGroupTemplate('<div
class="formSubmit">{content}</div>','grpSubmitReset');
$renderer->setGroupElementTemplate('{element}','grpSubmitReset');
$renderer->setRequiredNoteTemplate('<div class="note"><span
class="required">*</span> indicates
Required Field</div>');
This changes the renderer to wrap all of the form elements in DIVs and SPANs, removes the
table-based
defaults, and then I simply modify the appearance of each form using the CSS style sheet.
Hope that helps . . . .
-Tim
>I've built a number of forms now using the PEAR Quickform package, but I
>have been unable to change the rendering. The documentation doesn't include
>any useful examples, they seem to all be using template engines, which I am
>not allowed to use for the sites I am working on. Can anyone give me some
>hints on how to change the basic look of my forms?
>
>Cheers,
>
>--
>Nicolas Connault, PHP Developer
>-------------------------------
>ICQ: 826611
>Yahoo : nicolasconnault
>MSN: nikozeta@hotmail.com
>AIM: NikoZeta
>Skype: nicolasconnault
>Email: nicolasconnault@gmail.com
---------------------------------------
* Timothy Marsolais *
* http://www.Technology-Works.Net *
* 916.996.6542 *
* Build Projects that Matter *
---------------------------------------