bundles/BlockManagerAdminBundle/Menu/MainMenuBuilder.php
public function createMenu(): ItemInterface
    {
        $menu = $this->factory->createItem('root');

        if ($this->authorizationChecker->isGranted('nglayouts:ui:access')) {
            $menu
                ->addChild('layout_resolver', ['route' => 'ngbm_admin_layout_resolver_index'])
                ->setLabel('menu.main_menu.layout_resolver')
                ->setExtra('translation_domain', 'ngbm_admin');

            $menu
                ->addChild('layouts', ['route' => 'ngbm_admin_layouts_index'])
                ->setLabel('menu.main_menu.layouts')
                ->setExtra('translation_domain', 'ngbm_admin');

            $menu
                ->addChild('shared_layouts', ['route' => 'ngbm_admin_shared_layouts_index'])
                ->setLabel('menu.main_menu.shared_layouts')
                ->setExtra('translation_domain', 'ngbm_admin');
        }

        $this->eventDispatcher->dispatch(
            new ConfigureMenuEvent($this->factory, $menu),
            BlockManagerAdminEvents::CONFIGURE_MENU
        );

        return $menu;
    }
public function createMenu(): ItemInterface
    {
        $menu = $this->factory->createItem('root');

        if ($this->authorizationChecker->isGranted('nglayouts:ui:access')) {
            $menu
                ->addChild('layout_resolver', ['route' => 'ngbm_admin_layout_resolver_index'])
                ->setLabel('menu.main_menu.layout_resolver')
                ->setExtra('translation_domain', 'ngbm_admin');

            $menu
                ->addChild('layouts', ['route' => 'ngbm_admin_layouts_index'])
                ->setLabel('menu.main_menu.layouts')
                ->setExtra('translation_domain', 'ngbm_admin');

            $menu
                ->addChild('shared_layouts', ['route' => 'ngbm_admin_shared_layouts_index'])
                ->setLabel('menu.main_menu.shared_layouts')
                ->setExtra('translation_domain', 'ngbm_admin');
        }

        $this->eventDispatcher->dispatch(
            new ConfigureMenuEvent($this->factory, $menu),
            BlockManagerAdminEvents::CONFIGURE_MENU
        );

        return $menu;
    }
public function createMenu ( ) : ItemInterface { $ menu = $ this -> factory -> createItem ( 'root' ) ; if ( $ this -> authorizationChecker -> isGranted ( 'nglayouts:ui:access' ) ) { $ menu -> addChild ( 'layout_resolver' , [ 'route' => 'ngbm_admin_layout_resolver_index' ] ) -> setLabel ( 'menu.main_menu.layout_resolver' ) -> setExtra ( 'translation_domain' , 'ngbm_admin' ) ; $ menu -> addChild ( 'layouts' , [ 'route' => 'ngbm_admin_layouts_index' ] ) -> setLabel ( 'menu.main_menu.layouts' ) -> setExtra ( 'translation_domain' , 'ngbm_admin' ) ; $ menu -> addChild ( 'shared_layouts' , [ 'route' => 'ngbm_admin_shared_layouts_index' ] ) -> setLabel ( 'menu.main_menu.shared_layouts' ) -> setExtra ( 'translation_domain' , 'ngbm_admin' ) ; } $ this -> eventDispatcher -> dispatch ( new ConfigureMenuEvent ( $ this -> factory , $ menu ) , BlockManagerAdminEvents :: CONFIGURE_MENU ) ; return $ menu ; }
Builds the main menu.
Builds the main menu .