Arrays in Smarty
| From: | Liz Fulghum | Date: | Sun, 24 Aug 2003 06:07:49 +0000 |
| Subject: | Arrays in Smarty | ||
| Groups: | php.smarty.dev | ||
| Request: | Send a blank email to php-smarty-dev+get-1803@lists.php.net to get a copy of this message | ||
Hi there -
I'm having a bit of trouble with arrays in smarty and what hoping someone
could help.
In my php file I have an array called $picks filled and assigned to a smarty
variable.
In my template, I'm using cycle to loop through some html code:
{section name=i loop=$matches}
<tr>
<td><input type="radio" name="pick[{$matches[i].id}]"
value="1"{if
$picks.[$matches[i].id]==1} SELECTED{/if}
><b>{$matches[i].team1}</b></td></tr>
{/section}
I need to get the value of $pick['x'], where 'x' is equal to the value of
$matches[i].id
But the syntax above does not seem to be valid, and the other things I've
tried aren't working either.
Anyone know a way to do this?
TYIA.