sections and associative arrays
| From: | Alexander Gabriel | Date: | Fri, 19 Dec 2003 09:33:22 +0000 |
| Subject: | sections and associative arrays | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-9700@lists.php.net to get a copy of this message | ||
Hi group,
i've got a problem with an associative array.
if i'm doing:
[code]
<table>
{section name=MyRow loop=$MyValues}
<tr>
<td>{$MyValues[MyRow].ID}: {$MyValues[MyRow].Bezeichnung}</td>
</tr>
{/section}
</table>
[/code]
i get a table with the values 'ID' and 'Bezeichnung' from my SQL-result.
according to the documentation chapter 7, exapmle 19, this should work too:
[code]
<table>
{section name=MyRow loop=$MyValues}
<tr>
{section name=MyColumn loop=$MyValues[MyRow]}
<td>{$MyValues[MyRow][MyColumn]}</td>
{/section}
</tr>
{/section}
</table>
[/code]
but all i get is the same table as above but without any values.
I'm new to Smarty and maybe this is just a beginners mistake. would be
really nice if you could help me.
thx
Alexander Gabriel