Jump to main content Jump to doc navigation

modX::getTree

Get a site tree from a single or multiple modResource instances.

Syntax

API Doc: http://api.modx.com/revolution/2.2/db_core_model_modx_modx.class.html#%5CmodX::getTree()

array getTree ([int|array $id = null], [int $depth = 10])

Example

Get a tree for the Resource with ID 12. Only go 5 levels deep.

$treeArray = $modx->getTree(12,5);

See Also