Example #1
0
 /**
  * Convert a root node to a scope
  *
  * @param \Cmsable\Model\SiteTreeNodeInterface $node
  * @return \Cmsable\Routing\TreeScope\TreeScope
  **/
 public function node2Scope(SiteTreeNodeInterface $node)
 {
     $scope = new TreeScope();
     $urlSegment = trim($node->getUrlSegment(), '/');
     $name = $urlSegment ? $urlSegment : TreeScope::DEFAULT_NAME;
     $scope->setPathPrefix($node->getUrlSegment());
     $scope->setName($name);
     $scope->setTitle($node->getMenuTitle());
     $scope->setModelRootId($node->{$this->treeModel->rootCol()});
     return $scope;
 }
Example #2
0
 protected function toArray(Node $node, $routeName)
 {
     return ['id' => $node->getIdentifier(), 'path' => $node->getPath(), 'menu_title' => $node->getMenuTitle(), 'title' => $node->getTitle(), 'content' => $node->getContent(), 'routeName' => $routeName];
 }