public function NestedTitle($level = 2, $separator = " - ")
    {
        $item = $this;
        $parts = [];
        while ($item && $level > 0) {
            $parts[] = $item->Title;
            $item = $item->getParent();
            $level--;
        }
        return implode($separator, array_reverse($parts));
    }
public function NestedTitle($level = 2, $separator = " - ")
    {
        $item = $this;
        $parts = [];
        while ($item && $level > 0) {
            $parts[] = $item->Title;
            $item = $item->getParent();
            $level--;
        }
        return implode($separator, array_reverse($parts));
    }
public function NestedTitle ( $ level = 2 , $ separator = " - " ) { $ item = $ this ; $ parts = [ ] ; while ( $ item && $ level > 0 ) { $ parts [ ] = $ item -> Title ; $ item = $ item -> getParent ( ) ; $ level -- ; } return implode ( $ separator , array_reverse ( $ parts ) ) ; }
Return a string of the form "parent - page" or "grandparent - parent - page" using page titles

@param int $level The maximum amount of levels to traverse.
@param string $separator Seperating string
@return string The resulting string
Return a string of the form parent - page or grandparent - parent - page using page titles