public function createComponentNavigation($name)
 {
     $navigation = new Navigation();
     // nastavení překladače (nepovinné)
     $navigation->setTranslator(new MyTranslator());
     // nastavení šablony (nepovinné)
     $navigation->setTemplate('/cesta/k/sablone.phtml');
     $navigation->getRoot()->label = 'Homepage';
     $navigation->add('Articles', $this->link('Articles:default'));
 }
예제 #2
0
파일: Navigation.php 프로젝트: sulu/sulu
 /**
  * Merges the given navigation with this one and returns the result.
  * Works only if there are no duplicate of items in the same level.
  *
  * @param Navigation $navigation
  *
  * @return Navigation
  */
 public function merge(Navigation $navigation)
 {
     return new self($this->getRoot()->merge($navigation->getRoot()));
 }