SproutCMS

This is the code documentation for the SproutCMS project

function findAncestors()

Finds all ancestors of a specific node, including the node, not including the root node of the tree
The array is in order from top to bottom, so $ancestors[0] is the top-parent, and $ancestors[len-1] is the node.

        A
   B         C
 D   E     F   G
H I

NODE    RESULT ARRAY
 H       B D H
 D       B D
 B       B
 A       (empty)

Usage

static[] $Treenode->findAncestors ( );

Return value

  • static[]
    The ancestors, as described above.