/** * Add Navigation Element * * @param NavigationElementInterface $element The element to add */ public function addNavigationElement(NavigationElementInterface $element) { if (!$element->getParent() && count($this->elements)) { $element->setParent(end($this->elements)); } $this->breadcrumbs->addElement($element); $this->pageTitle->addElement($element); $this->elements[] = $element; $this->element = $element; }
/** * Add an element to the Breadcrumbs and the Page Title * * @param NavigationElementInterface $element The element to push in the navigation stack * * @throws \Exception */ public function addNavigationElement(NavigationElementInterface $element) { $this->breadcrumbs->addElement($element); $this->pageTitle->addElement($element); $this->element = $element; }