Re: [SMARTY] Confused about passing Arrays to Smarty Template

From: Date: Mon, 14 Apr 2003 19:12:44 +0000
Subject: Re: [SMARTY] Confused about passing Arrays to Smarty Template
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-9249@lists.php.net to get a copy of this message
I think thats like that: [php] $x=1; foreach(array("a","b","c") as $letter) { foreach (array("1","2","3") as $number) { $Arr{$letter}{$number} = $x; $x++; } } $Smarty->assign('zoukzouk', $Arr); [/php] ...and in your tpl... [tpl] {foreach from=$zoukzouk item=takatak} {foreach from=$takatak item=rogntudju key=num} {$rogntudju[$num]} {/foreach} {/foreach} [/tpl] hope this will help you. Bye!

« previous php.smarty.general (#9249) next »