[prev in list] [next in list] [prev in thread] [next in thread] 

List:       smarty-dev
Subject:    [SMARTY-DEV] complex section - loop
From:       213.123.172.87
Date:       2003-07-04 11:59:24
[Download RAW message or body]

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


-- 
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic