Forums / Developer / Loop through items in object / Comment46278
Łukasz Serwatka
Monday 03 July 2006 11:30:09 pm
First you need to assing value to the TPL variable $myObject. In TPL define variable then in PHP use
$tpl->setVariable( 'myObject', $myObject );
Then you need to use:
{foreach $myObject[0] as $index => $value} {$index} : {$value} {/foreach}
or just
$tpl->setVariable( 'myObject', $myObject[0] );
then
{foreach $myObject as $index => $value} {$index} : {$value} {/foreach}
Personal website -> http://serwatka.net Blog (about eZ Publish) -> http://serwatka.net/blog