For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > August 2004 > HTML_QuickForm's renderer->setElementTemplate -- can access id/name of field?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author HTML_QuickForm's renderer->setElementTemplate -- can access id/name of field?
Miles Keaton

2004-08-24, 4:40 pm

In HTML_QuickForm's renderer->setElementTemplate:

Can I access id/name of field?

If I wanted my elements to look like this...

<tr>
<th><label for="yourname">Your Name:</label></th>
<td><input name="yourname" type="text" /></td>
</tr>

.... then my ElementTemplate would need to use a variable that holds
the element/input name.

Right now the template seems to only let me use {label} and {element}.
Any way to get {element.name} or {element.id}?

It looks like HTML_QuickForm_Renderer_Default->renderElement is just doing:
str_replace('{element}', $element->toHtml(), $html);
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com