Forums / Developer / Getting Attribute Content
Björn [email protected]
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
Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs Looking for hosting? http://hostingezpublish.com ----------------------------------------------------------------------------- GMT +01:00 Hannover, Germany Web: http://www.xrow.com/
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