RE: [SMARTY] Looping through an array of objects
| From: | Josh Johnson | Date: | Thu, 17 Oct 2002 14:54:56 +0000 |
| Subject: | RE: [SMARTY] Looping through an array of objects | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-6188@lists.php.net to get a copy of this message | ||
I'd use a foreach...
{foreach from=$myObjArray item=this_object}
<li>{$this_object->property}</li>
{/foreach}
-----Original Message-----
From: Philippe Desaulniers [mailto:filou@histrion.org]
Sent: Wednesday, October 16, 2002 11:30 PM
To: smarty-general@lists.php.net
Subject: [SMARTY] Looping through an array of objects
Hello,
I'm trying to loop in a section, through an array of objects. Is there
any way to get to my object properties?
An example of what I'd like it to do is this:
{section name=sec1 loop=$myObjArray}
<li>{$myObjectArray[sec1]->myObjectProperty}
{/section}
Thanks,
phil
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php