RE: Re[2]: [SMARTY] Am I being daft? Arrays...
| From: | Andrew S. Nagy | Date: | Mon, 07 Apr 2003 19:41:10 +0000 |
| Subject: | RE: Re[2]: [SMARTY] Am I being daft? Arrays... | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-9178@lists.php.net to get a copy of this message | ||
You could try using a foreach, that's what I always use due to PHP habits.
The foreach in smarty has a key field so you can specify something like
this:
___PHP___
$smarty->assign_by_ref("storyList", $storyList[$i]);
___Template___
{foreach from=$storyList item=story key=stid}
Story #{$stid} is: {$story}
{/foreach}
Andrew
> -----Original Message-----
> From: Katana [mailto:katana@katana-inc.com]
> Sent: Monday, April 07, 2003 11:41 AM
> To: John Wards
> Cc: smarty-general@lists.php.net
> Subject: Re[2]: [SMARTY] Am I being daft? Arrays...
>
>
> JW> The {arrrrgh} bit was a joke...
> :)
>
> JW> I want to get the value for [story].
> JW> Would $smarty.section.story_stid.index Do it?
> Did you try ? :)
> All you need is on the documentation
>
> Katana
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>