AW: [PEAR] sections and associative arrays
| From: | Andreas Otterstein | Date: | Fri, 19 Dec 2003 09:54:55 +0000 |
| Subject: | AW: [PEAR] sections and associative arrays | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-9702@lists.php.net to get a copy of this message | ||
Hi,
This ist the wrong mailing list. Smarty has ist own.
Nevertheless yout second example is not really ok.
You must set a variable in the loop of the second section (e.g.
loop=$MyValues[MyRow].ID )
Andreas Otterstein
-----Ursprüngliche Nachricht-----
Von: Alexander Gabriel [mailto:alexander.gabriel@blubbermania.com]
Gesendet: Freitag, 19. Dezember 2003 10:33
An: pear-general@lists.php.net
Betreff: [PEAR] sections and associative arrays
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
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php