Re: [SMARTY] Arrays

From: Date: Tue, 29 Oct 2002 13:52:03 +0000
Subject: Re: [SMARTY] Arrays
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-6257@lists.php.net to get a copy of this message
Have you tried {$onderwerpen.$key}? The {} signify portions of the template that smarty should be parsing. They do not allow for nesting in this context. > > Hello, > > I'm working with smarty but i have some difficulties with arrays: > > The following code won't work: > <table cellpadding=0 cellspacing=0> > {foreach from=$results key=key item=index} > <tr><td>{$onderwerpen.{$key}}</td></tr> > {foreach from=$index item=filez} > ---- SNAP ---- > {/foreach} > {/foreach} > </table> > > As you might see this is resposible for the error: > <tr><td>{$onderwerpen[{$key}]}</td></tr> > > In normal PHP i want to have > > $onderwerpen[$key] but it seems inpossible to acomplish this. > > Does anyone know how to use a key from a foreach in an array index?! > > Thanx > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

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