Re: Updating FormBuilder broke the dynamic QuickForm renderer
| From: | Dan Rossi | Date: | Wed, 06 Jul 2005 17:07:43 +0000 |
| Subject: | Re: Updating FormBuilder broke the dynamic QuickForm renderer | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-19880@lists.php.net to get a copy of this message | ||
On 07/07/2005, at 2:55 AM, Justin Patrin wrote:
With FormBuilder , i had to revert back to looping through a section {foreach:form.sections,sec} {foreach:sec.elements,elem}Sorry I've never used flexy. Could you show us an example of the changes? I suggest comparing QF objects both pre and post update.
{if:elem.style}
{elem.outputStyle():h}
{else:}
{if:elem.isButton()}
{if:elem.notFrozen()}
<tr>
<td width="250" class="searchfield"></td>
<td class="searchoption" width="450">{elem.html:h}</td>
</tr>
{end:}
{else:}
<tr>
{if:elem.isType(#textarea#)}
<td width="250" class="searchfield">
<b>{elem.label:h}</b><br />
{else:}
<td width="250" class="searchfield">
<b>{elem.label:h}:</b></td>
</td>
{end:}
<td class="searchoption" width="450">
{if:elem.error}<font color="red">{elem.error}</font><br />{end:}
{if:elem.isType(#group#)}
{foreach:elem.elements,gitem}
{gitem.label:h}
{gitem.html:h}{if:gitem.required}<font color="red">*</font>{end:}
{if:elem.separator}{elem.separator:h}{end:}
{end:}
{else:}
{elem.html:h}
{end:}
</td>
</tr>
{end:}
{end:}
{end:}
{end:}
For a standard QuickForm (no FormBuilder) I can loop through the elements directly
{foreach:form.elements,elem}
{if:elem.style}
{elem.outputStyle():h}
{else:}
{if:elem.isButton()}
{if:elem.notFrozen()}
<tr>
<td> </td>
<td align="left">{elem.html:h}</td>
</tr>
{end:}
{else:}
<tr>
{if:elem.isType(#textarea#)}
<td colspan="2" class="formlabel">
{if:elem.required}<font color="red">*</font>{end:}<b>{elem.label:h}</b><br />
{else:}
<td align="right" valign="top" class="formlabel">
{if:elem.required}<font color="red">*</font>{end:}<b>{elem.label:h}:</b></td>
<td>
{end:}
{if:elem.error}<font color="red">{elem.error}</font><br />{end:}
{if:elem.isType(#group#)}
{foreach:elem.elements,gitem}
{gitem.label:h}
{gitem.html:h}{if:gitem.required}<font color="red">*</font>{end:}
{if:elem.separator}{elem.separator:h}{end:}
{end:}
{else:}
{elem.html:h}
{end:}
</td>
</tr>
{end:}
{end:}
{end:}