Re: Quickform, Controller, Renderer and Templates
| From: | Dario | Date: | Wed, 28 Apr 2004 00:59:42 +0000 |
| Subject: | Re: Quickform, Controller, Renderer and Templates | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-12177@lists.php.net to get a copy of this message | ||
On Tue, 2004-04-27 at 19:08, Bertrand Mansion wrote:
> <phpdev@growingman.com> wrote :
>
...<snip>...
> >
> > $tpl =& new HTML_Template_Sigma('./templates');
> > $tpl->loadTemplateFile('uploadS.tpl.html');
> > $renderer =& new HTML_QuickForm_Renderer_ITStatic($tpl);
> > $renderer->setRequiredTemplate('{label}<font color="red"
> > size="1">*</font>');
> > $renderer->setErrorTemplate('<font
> > color="red">{error}</font>
> > <br />{html}');
> >
> > I believe the names in the template don't match with those generated by
> > the Controller and I can't figure out the naming convention.
> > e.g.: I couldn't find in the documentation that elements must be named
> > form_element as in myform_radio where myform is the form name given to
> > QF.
>
> Do you use the method accept() somewhere ?
> I think an example was posted on the list maybe 2-3 weeks ago (with Smarty,
> but that's the same idea).
>
> Bertrand Mansion
> Mamasam
Yes, I did use accept() just after the snippet listed. Those lines are
the only thing I changed.
I looked for the example and I'm still having troubles.
>From this and other attempts I gathered that I don't understand the
placeholders naming conventions.
Is it:
form_group_element_index_type
where index could be missing and type it's normally either label or
html?
Another example uses:
form.group.element.type
Can you point out where this is explained in the documentation? I seem
to have missed it.
Without knowing this I don't understand how to tell the template where
to put my elements or what I want where I want it. Am I being a control
freak? :)
Thanks for your help
Dario