Forums / Developer / Getting Attribute Content
Björn X
Thursday 24 April 2003 4:34:05 am
Unfortunatelly $contentObject->attributes(); is returning an array and not an array of objects of contentobjectattributes Where is my failure?How can i get the content?
$contentObject = eZContentObject::fetch( 269 ); var_dump($contentObject); $attributes =& $contentObject->attributes(); var_dump($attributes); // Loop each attribute foreach ( $attributes as $attribute ) { print( "Content : " . $attribute->content() );}
thx Björn
Bård Farstad
Thursday 24 April 2003 4:42:44 am
Try the function contentObjectAttributes.
$attributes =& $object->contentObjectAttributes();
Or you can use the dataMap() function which will create an associative array with the attributes hashed by name.
$dataMap =& $object->dataMap();
$title = $dataMap['title'];
--bård
Documentation: http://ez.no/doc