Re: [SMARTY] How to pass an array to an included template

From: Date: Fri, 21 Mar 2003 10:52:40 +0000
Subject: Re: [SMARTY] How to pass an array to an included template
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-8800@lists.php.net to get a copy of this message
Thanks Didier Messju Mohr wrote:
On Wed, Mar 19, 2003 at 10:26:26PM +0100, Didier wrote:
The subject more or less says it all. I have the following scenario: All my pages have the same layout ie: page title, a bar on the left with some 'menu' entries made of hrefs... I have decided to put the header & menu displaying in one tpl that should just be included by all other .tpl. I must be stupid, but have not found a way to send arrays to an included file. Sending single variables is fine, arrays beats me.
it should make not difference to strings. if you assign $smarty->assign('menu', array(1,2,4,5)) in the php before, then {$menu} should be visible in all templates. if you {include "nav.tpl" nav=$menu"} then {$nav} should also be an array.
Any help will be warmly welcomed. Didier


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