Wednesday 28 June 2006 4:40:07 am
I have created an extension module, that reads data from a non-ez-table, and returns it as an object. Now I would like to loop through the contents of the object and output both name (key) of each field and its contents it in the template, with something like this:
{foreach $myObject as $object}
{$:index} : {$:key} : {$:value}
{/foreach}
I have however not been clever enough to achieve this. I can easily access individual values like this: {$:item.first_name}. the contents of $myObject looks like this:
Array
(
[0] => mymodule Object
(
[PersistentDataDirty] =>
[id] => 1
[contentobject_id] =>
[remote_id] => 1574
[first_name] => MyName
[last_name] => LastName
[address1] => Drammensveien 1
[address2] =>
[address3] =>
[postal_code] => 10
[postal_addr] => Oslo
)
)
Any tips?
|