protected function getPathToRoot(AbstractNode $node) { $id = $node->getId(); $depth = substr_count($id, '/'); if ($id != 'index' && $node instanceof DirectoryNode) { $depth++; } return str_repeat('../', $depth); }