Hey guys,
I'm having a syntax problem with Smarty's {section} function.
I have an array being passed to smarty (it's actually a QuickForm date element with three sub-elements, d M & Y) and would like to loop on that according to a set number:
The entire form is assigned to 'form_data' smarty variable.
This outputs the date element as:Code:<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.Code:<select name="eventdates[d]"> <!-- options here //--> </select> <select name="eventdates[M]"> <!-- options here //--> </select> <select name="eventdates[Y]"> <!-- options here //--> </select>
If I do it with the html renderer I get (pseudo-code):
Can anyone help me get the same result with Smarty? I just can't seem to get it workingCode:'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 dev.burodefunk.com/qf/ of the form using the default renderer. Any help would be appreciated.
Thanks in advance;
Poncho





Bookmarks