eZ Community » Forums » Developer » Fetch path_array directly in PHP
expandshrink

Fetch path_array directly in PHP

Fetch path_array directly in PHP

Tuesday 19 January 2010 11:45:17 am - 2 replies

Hi there,

I would like to know how to fetch the path_array of a node from PHP.

I tried something like this :

$object = eZContentObject::fetchByNodeID($node_id);
$url = $object->attribute("path_array");

or

$path = new eZPathElement(array("id" => $node_id));
$path_array = $path->getPathArray();

But I still not able to get the path_array for a defined node_id.

Could someone help me ?

Thanks,

Damien

Modified on Wednesday 24 March 2010 9:18:53 am by Damien MARTIN

Tuesday 19 January 2010 2:31:40 pm

You should fetch a node - not an object.

Try this:

$mynode = eZContentObjectTreeNode::fetch( $node_id );
 
$my_path_array = $mynode->attribute( 'path_array' );

Please notice that you will get an array in $my_path_array - not URL.

Kind regards

J

Modified on Tuesday 19 January 2010 2:36:57 pm by Jarosław-- Heba

Tuesday 19 January 2010 2:38:28 pm

Thank you very much Jarosław,

It works very well.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from