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')); }
/** * 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())); }