looping complex array
| From: | Tomas Sanchez Romani | Date: | Tue, 22 May 2001 09:40:12 +0000 |
| Subject: | looping complex array | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-783@lists.php.net to get a copy of this message | ||
Hi, I have an array that looks like this.
dagar(
0 =3D ("datum" =3D "2001-10-01"
"lokaler" (
"lokal_id" =3D 1,
...
)
"utrustning" (
"utr_id" =3D 42
...
)
)
1 =3D ("datum" =3D "2001-10-02"
"lokaler" (
"lokal_id" =3D 2,
...
)
"utrustning" (
"utr_id" =3D 43
...
)
)
)
Ok, what I would like to do is to in the outmost loop I need to get the
"datum"-value and then in inner loops I nedd to get the value of "lokal_id".
What I have come up with so far is this (and it doesn't work).
{section name=sec1 loop=$dagar}
{$dagar[sec1]}
{section name=sec2 loop=$dagar[sec1].lokaler}
{$dagar[sec1].lokaler[lokal_id]}
{/section}
{/section}
Where did I go wring, to make it like this?
regards, tomas