Re: [SMARTY] Assoc. array reference

From: Date: Wed, 25 Aug 2004 15:35:41 +0000
Subject: Re: [SMARTY] Assoc. array reference
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-11723@lists.php.net to get a copy of this message
--- Tom Van Den Berghe <Tom.Van.Den.Berghe@febelfin.be> wrote: > Hi, > > I have an assoc. array: > $docs=array("en"=>documentObject,"fr"=>documentObject,"nl"=>documentObje > ct) > There's a session variable $lang > > How do I reference the value in the $docs-array with $lang as key? > > $docs.$smarty.session.lang doesn't work. Hi. Try: {assign var=lang value=$smarty.session.lang} {$docs.$lang} or {$docs[$smarty.session.lang]} xo boots > > Thanks > > Tom

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