I have an array of stdclass objects. How can I assign it to a smarty template?
I tried to do this:
$smarty->assign( 'objects', $x->getAllObjects() );
but the result is an error:
Catchable fatal error: Object of class Object could not be converted to string
Thanks
edit: I also tried:
$smarty->registerObject( 'objects', $x->getAllObjects() );
and in the template file I did:
{foreach from=$objects item=o}
{$o}
{/foreach}
but I get a notice:
Notice: Undefined index: objects
and I can't access the elements of objects array.