Re: looping complex array
| From: | Ivo Jansch | Date: | Tue, 22 May 2001 13:52:52 +0000 |
| Subject: | Re: looping complex array | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-784@lists.php.net to get a copy of this message | ||
Hi,
> {section name=sec1 loop=$dagar}
> {$dagar[sec1]}
>
> {section name=sec2 loop=$dagar[sec1].lokaler}
> {$dagar[sec1].lokaler[lokal_id]}
> {/section}
>
> {/section}
I'm not sure if I understand your datastructure. It's mangled by your
mailclient or some mailserver along the way. My guess is that the index
of your inner loop is wrong, and for the date, you need to specify
'.datum', because it's an associative array.
Try this:
{section name=sec1 loop=$dagar}
{$dagar[sec1].datum} <- this will display the date..
{section name=sec2 loop=$dagar[sec1].lokaler}
{$dagar[sec1].lokaler[sec2].lokal_id} <- this will display the
lokal_id
{/section}
{/section}
Greetings,
Ivo
--
Ivo Jansch <ivo@ibuildings.nl>
ibuildings.nl BV - information technology
http://www.ibuildings.nl