Re: [SMARTY] Non-associative arrays
| From: | Roman Neuhauser | Date: | Sat, 29 Jun 2002 13:04:35 +0000 |
| Subject: | Re: [SMARTY] Non-associative arrays | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-5096@lists.php.net to get a copy of this message | ||
> Date: Fri, 28 Jun 2002 22:16:30 -0400 (EDT)
> From: "L. Patrick Smallwood" <iamsure@fatmonkey.psychasia.com>
> To: smarty-general@lists.php.net
> Subject: [SMARTY] Non-associative arrays
>
> How does one assign non-associative arrays from php to a smarty template?
>
> For example the (pseudo) code snippet:
>
> $smarty->assign("some_var[i]", $var[i]);
> or even $smarty->assign("some_array", $var);
>
> Where ..
>
> $var[1] = "something"; $var[2] = "something_else";
>
> I am sure this has come up before, but a search through the mailing list
> archive, and thru the documentation didnt seem to help. :(
have you actually tried it?
$smarty->assign('FOO', array('bar', 'baz', 'qux'));
{foreach from=$FOO item=x}
{$x}<br>
{/foreach}
--
FreeBSD 4.6-STABLE
3:02PM up 20:37, 3 users, load averages: 0.05, 0.01, 0.08