Re: [SMARTY] Problem with nested sections on multidimensional associative arrays
| From: | Robert Amos | Date: | Wed, 24 Apr 2002 01:56:32 +0000 |
| Subject: | Re: [SMARTY] Problem with nested sections on multidimensional associative arrays | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-3859@lists.php.net to get a copy of this message | ||
Have you tried using the following to access the internal array?
{$group[group].game[game].GameId}
-bok
On 24/4/02 9:19 AM, Ingmar Heinrich banged a keyboard and produced the
following weird but readable email:
> Hi.
>
> My debug looks like that:
>
> {$group} Array (8)
> 0 => Array (2)
> GroupName => A
> game => Array (6)
> 0 => Array (14)
> GameId => 1
> ...
> 1 => Array (14)
> GameId => 3
> ...
> 2 => Array (14)
> GameId => 18
> ...
> 3 => Array (14)
> GameId => 20
> ...
> 4 => Array (14)
> GameId => 33
> ...
> 5 => Array (14)
> GameId => 34
> ...
> 1 => Array (2)
> GroupName => B
> game => Array (6)
> 6 => Array (14)
> GameId => 6
> ...
> 7 => Array (14)
> GameId => 8
> ...
>
> .. and so on.
>
> I get the outer section with
>
> {section name="group" loop=$group}
>
> which works well:
>
> <tr>
> <td colspan="7" bgcolor="white">Gruppe
> {$group[group].GroupName}</td>
> </tr>
>
> Then I try to do the inner loop:
>
> {section name="game" loop=$group[group].game}
>
> Seems to be the correct syntax, since the number of iterations is correct.
> But how do I address the inner values now?? I tried many ways, such as
>
> <td>{$group[group][game].GameId}</td>
>
> - no output. I'm sure it's rather trivial, but I just don't grasp it. Some
> please HEEEELP :o)
>
> Regards,
> Ingmar
>
> --
> Ingmar Heinrich <ingmar.heinrich@hamburg.de>
>