complex section - loop

From: Date: Fri, 04 Jul 2003 11:59:24 +0000
Subject: complex section - loop
Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-1718@lists.php.net to get a copy of this message
Didn't realise one could get array values as in the selected item in the following example - selected=$forms[f].fnext_id[$k] - maybe this should go in the manual the array - Array (9)
	    form_id => 15
	    title => yo
	    parent => 0
	    next_id => 14
	    frm => 0
	    field_id => 60
	    caption => Branch to go
	    options => Array (3)
	      0 => go here
	      1 => go there
	      2 => go everywhere
	    fnext_id => Array (3)
	      0 => 14
	      1 => 11
	      2 => 20
{section name=frm loop=$forms} <table cellpadding="2" cellspacing="1" > {foreach from=$forms[f].options item=i key=k} <tr> <td align="right">{$i}</td> <td> <select name="fnext_id[{$forms[f].field_id}]" class="fld"> {html_options options=$redirects selected=$forms[f].fnext_id[$k]} </select> </td> </tr> {/foreach} </table> {/section} Pete

« previous php.smarty.dev (#1718) next »