Smarty output of dynamic QuickForm
| From: | Poncho Pilate | Date: | Sat, 10 Sep 2005 11:24:45 +0000 |
| Subject: | Smarty output of dynamic QuickForm | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-20896@lists.php.net to get a copy of this message | ||
Hey guys,
Don't laugh. I'm having a syntax problem with Smarty.
I have an array being passed to smarty (it's actually a series of date groups with three elements each, d-M-Y) and would like to loop on that according to the {$num_dates} Smarty variable:
The entire form is assigned to 'form_data' Smarty variable.
<span>{$form_data.eventdates.label}<br />
{$form_data.eventdates.html}
</span>
I need to duplicate this as many times as is needed according to the {$num_dates} variable.
If I do it with the html renderer I get (pseudo-code):
'eventdates[0][d]','eventdates[0][M]','eventdates[0][Y]'
'eventdates[1][d]','eventdates[1][M]','eventdates[1][Y]'
'eventdates[2][d]','eventdates[2][M]','eventdates[2][Y]'
I've got a rough example up on http://dev.burodefunk.com/qf/ of the form using the default renderer.
Can anyone help me get the same result with Smarty? I just can't seem to get it working. I'm quite frustrated as I could easily do this with procedural code but I don't wanna go there :(
Any help would be appreciated.
!Code based on http://www.pookey.co.uk/wiki/pear/dynamic_quickform/ by Ian P. Christian.
Thanks in advance;
Poncho