If the routename start with ".divider" the item will be used as a divider.

@return MenuItem
761589
protected function fetchItemVariantDivider()
    {
        if ($this->getOption('is_divider') || substr($this->getRouteName(), 0, 8) == '.divider')
        {
            $this->isDivider = true;
            $this->options['title'] = 'dummy';
        }

        return $this;
    }
733047
public function matchItem(ItemInterface $item)
    {
        if (null === $this->getRequest()) {
            return null;
        }

        $route = $this->getRequest()->attributes->get('_route');
        $routeParameters = $this->getRequest()->attributes->get('_route_params');

        if (null === $route) {
            return null;
        }


        $routes = $item->getExtra('routes', []);
        if (false === is_array($routes)) {
            return null;
        }

        foreach ($routes as $testedRoute) {
            /* Route matching? */
            if ($route !== $testedRoute['route']) {
                continue;
            }

            /* No Parameters? */
            if (false === is_array($routeParameters) || 0 === count($routeParameters)) {
                return true;
            }

            /* Parameters only in current route? */
            if (false === isset($testedRoute['parameters']) || false === is_array($testedRoute['parameters'])) {
                continue;
            }

            /* Assume match, until different parameters are found */
            $matching = true;

            foreach ($routeParameters as $index => $value) {
                /* Ignore underscored parameters */
                if ('_' === substr($index, 0, 1)) {
                    continue;
                }

                /* Parameter not found */
                if (false === isset($testedRoute['parameters'][$index])) {
                    $matching = false;

                    break;
                }

                /* Parameter not matching */
                if ($testedRoute['parameters'][$index] !== $value && ((0 < $testedRoute['parameters'][$index]) || false === is_numeric($value))) {
                    $matching = false;

                    break;
                }
            }

            if (true === $matching) {
                return true;
            }

        }

        return null;
    }
1280693
public function divide(): self
    {
        return static::create(
            [
                $this->keys(),
                $this->values(),
            ],
            $this->iteratorClass,
            false
        );
    }
1012297
public function modular()
    {
        $modular = [];

        foreach ($this->items as $path => $slug) {
            $page = $this->pages->get($path);
            if ($page !== null && $page->modular()) {
                $modular[$path] = $slug;
            }
        }
        $this->items = $modular;

        return $this;
    }
440475
public static function menuToRules($items)
    {
        $rules = [];
        foreach ($items as $item) {
            $url = ArrayHelper::getValue($item, 'url');
            $urlRule = ArrayHelper::getValue($item, 'urlRule');

            if ($url && $urlRule && is_array($url)) {
                $defaults = $url;
                $route = array_shift($defaults);

                if (is_string($urlRule)) {
                    $rules[] = [
                        'pattern' => Yii::getAlias($urlRule),
                        'route' => $route,
                    ];
                } elseif (is_array($urlRule)) {
                    if (!isset($urlRule['route'])) {
                        $urlRule['route'] = $route;
                    }
                    $rules[] = $urlRule;
                }
            }

            $subItems = ArrayHelper::getValue($item, 'items');
            if (is_array($subItems)) {
                $rules = array_merge(static::menuToRules($subItems), $rules);
            }
        }
        return $rules;
    }
1211255
private function menuHelper($item)
    {
        // recurse into submenus
        if (isset($item['submenu']) && is_array($item['submenu'])) {
            $item['submenu'] = $this->menuHelper($item['submenu']);
        }

        if (isset($item['route'])) {
            $item['link'] = $this->resolveRouteToLink($item);
        } elseif (isset($item['path'])) {
            $item = $this->resolvePathToContent($item);
        }

        return $item;
    }
1064238
public function getRootParent(MenuItemInterface $menuItem)
    {
        if (!$menuItem->getId()) {
            return false;
        }

        if ($parent = $menuItem->getParent()) {
            return $this->getRootParent($parent);
        }

        return $menuItem;
    }
1303967
protected static function menuitem_for_controller($controllerClass)
    {
        $urlBase = AdminRootController::admin_url();
        $urlSegment   = Config::inst()->get($controllerClass, 'url_segment');
        $menuPriority = Config::inst()->get($controllerClass, 'menu_priority');
        $ignoreFromMenu = Config::inst()->get($controllerClass, 'ignore_menuitem');

        // Don't add menu items defined the old way, or for controllers that are set to be ignored
        if (!$urlSegment || $ignoreFromMenu) {
            return null;
        }

        $link = Controller::join_links($urlBase, $urlSegment) . '/';

        // doesn't work if called outside of a controller context (e.g. in _config.php)
        // as the locale won't be detected properly. Use {@link LeftAndMain->MainMenu()} to update
        // titles for existing menu entries
        $menuTitle = LeftAndMain::menu_title($controllerClass);

        return new CMSMenuItem($menuTitle, $link, $controllerClass, $menuPriority);
    }
1098676
protected function buildItems()
    {
        $items = [];

        if ($this->getItemCollection() !== null) {
            $menuLevelCollection = $this->getItemCollection();
        } else {
            $entryParentNode = $this->findMenuStartingPoint();
            if ($entryParentNode === null) {
                return $items;
            }
            $menuLevelCollection = $entryParentNode->getChildNodes($this->getFilter());
        }

        $items = $this->buildMenuLevelRecursive($menuLevelCollection);

        return $items;
    }
344513
public function getGateway()
    {
        if (null === $this->_gateway) {
            $this->_gateway = Commerce::getInstance()->getGateways()->getGatewayById($this->gatewayId);
        }

        return $this->_gateway;
    }
1144878
protected function fetchParent()
    {
        $parent = $this->getOption('parent');
        if ($parent instanceof MenuItem)
        {
            $this->setParentItem($parent);
        }

        return $this;
    }
1314790
public function getMenu()
    {
        // Retrieve the item from cache since we're going to have to build this out manually
        $items = array();
        $fullRoutes = explode('|', $this->menu);
        foreach ($fullRoutes as $route)
        {
            if ($route == "")
                continue;
            $items[] = array('label' => ucwords(str_replace('-', ' ', $route)), 'url' => Yii::app()->createUrl('/' . $route), 'active' => false);
        }

        return $items;
    }
1048211
function formatter(data, parentAuthority, parentName) {
  if (!data) {
    return undefined;
  }
  return data
    .map(item => {
      if (!item.name || !item.path) {
        return null;
      }

      let locale = 'menu';
      if (parentName && parentName !== '/') {
        locale = `${parentName}.${item.name}`;
      } else {
        locale = `menu.${item.name}`;
      }
      const result = {
        ...item,
        title:locale
      };
      if (item.routes) {
        const children = formatter(item.routes, item.authority, locale);
        // Reduce memory usage
        result.children = children;
      }
      delete result.routes;
      return result;
    })
    .filter(item => item);
}
1087870
public function getItemUrlAttribute()
    {
        if( $this->type == 'link' ) {
            return $this->url;
        }

        if( $this->type == 'page' && ! is_null($this->page) )
            return $this->page->page_url;

        return '';
    }
1067136
public function subMenu($key = null, $menuItem = null)
    {
        if (null === $menuItem) {
            return $this->subMenu;
        }

        if (is_callable($menuItem)) {
            $menu = new AdminMenu($menuItem);
            $this->subMenu[$key] = $menu;
        } else {
            $this->subMenu[$key] = $menuItem;
        }

        return $this;
    }
275451
public function getCurrent()
    {
        if ($this->currentCache !== null) {
            return $this->currentCache;
        }
        /* @var $active MenuItem */
        $active = null;
        do {
            /* @var MenuItem[] $children */
            $children = $this->getChildren($active);
            $foundActiveChild = false;
            foreach ($children as $child) {
                if ($child->getActive()) {
                    $foundActiveChild = true;
                    $active = $child;
                    break;
                }
            }
        } while ($foundActiveChild);
        $this->currentCache = $active;

        return $active;
    }
89904
public static function getMenu()
    {
        return (new \Mmi\Navigation\NavigationConfigElement)
            ->setId('admin-menu')
            ->setLabel('menu.index.index')
            ->setModule('cmsAdmin')
            ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                ->setModule('cmsAdmin')
                ->setDisabled()
                ->setAction('password')
                ->setLabel('menu.index.password'))
            ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                ->setModule('cmsAdmin')
                ->setAction('login')
                ->setIcon('fa-unlock-alt')
                ->setLabel('menu.index.login')
                ->setDisabled())
            ->addChild(
                (new \Mmi\Navigation\NavigationConfigElement)
                    ->setLabel('menu.container')
                    ->setIcon('fa-cog')
                    ->setUri('#')
                    ->addChild(NavPart\NavPartCategory::getMenu())
                    ->addChild(NavPart\NavPartText::getMenu())
                    ->addChild(NavPart\NavPartMail::getMenu())
                    ->addChild(NavPart\NavPartStat::getMenu())
                    ->addChild(NavPart\NavPartContact::getMenu())
                    ->addChild(NavPart\NavPartAuth::getMenu())
                    ->addChild(NavPart\NavPartSystem::getMenu())
            );
    }