Re: [SMARTY] Objects with associative arrays
| From: | schultzr at kattare dot com | Date: | Mon, 28 Apr 2003 03:13:19 +0000 |
| Subject: | Re: [SMARTY] Objects with associative arrays | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-9398@lists.php.net to get a copy of this message | ||
> I have an object (let's call it "book") that has an associative array
>
> ("arrRole") as a member variable. So I assigned (not registered, as
> per
> the docs) the object to the template, and wanted to do something like
>
> this, to loop over all the items in the array:
> {section name=role loop=$book->arrRole.create}
> {$book->arrRole.read[role]}
> {$book->arrRole.write[role]}
> {/section}
>
Wouldn't you need to write them like this
{$book->arrRole[role].read}
{$book->arrRole[role].write}
?
Since arrRole is your Array..?
> Thanks in advance
> Tryggvi
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
Rob