[SMARTY] Arrays
| From: | Hofstede, Julien | Date: | Tue, 29 Oct 2002 12:24:30 +0000 |
| Subject: | [SMARTY] Arrays | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-6256@lists.php.net to get a copy of this message | ||
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