Good time of day.
Tell me why my class for the tag
does not reach the view function.
In this part of the code is prescribed configuration for menu items.
'navigation' => [ 'Application\avigation\\MainNavigation' => [ 'application' => [ /** * Set options for the 'ul'-element. * For correct set - page must have the most lowest order number (e.g. -100). */ 'ul' => ['class' => 'navbar-nav align-content-between'], 'li' => ['class' => 'nav-item m-auto'], /** Set attributes for 'a'-element. */ 'a' => ['class' => 'nav-link'], 'label' => 'Main', /** Set options for an element. */ 'order' => 10, 'route' => 'home', 'action' => 'index', 'controller' => Controller\\IndexController::class, ],
And this part of code responsible for processing the tag
public function htmlify(AbstractPage $page, $escapeLabel = true, $addClassToListItem = false) { // get attribs for element $attribs = [ 'id' => $page->getId(), 'title' => $this->translate($page->getTitle(), $page->getTextDomain()), ]; /** * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Begin fork ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * * @since 18:37 30.10.2016 */ // add additional attributes $attr = $page->get('attr'); if(is_array($attr)){ $attribs = $attribs + $attr; }; /** * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End fork ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ if ($addClassToListItem === false) { $attribs['class'] = $page->getClass(); } // does page have a href? $href = $page->getHref(); if ($href) { $element = 'a'; $attribs['href'] = $href; $attribs['target'] = $page->getTarget(); } else { $element = 'span'; } $html = '<'. $element . $this->htmlAttribs($attribs) . '>'; $label = $this->translate($page->getLabel(), $page->getTextDomain()); if ($escapeLabel === true) { /** @var \\Zend\\View\\Helper\\EscapeHtml $escaper */ $escaper = $this->view->plugin('escapeHtml'); $html .= $escaper($label); } else { $html .= $label; } $html .= '</'. $element . '>'; return $html; }