示例#1
0
 public function map(MenuBuilder $builder, Router $router)
 {
     foreach ($builder->get() as $menu) {
         if ($menu->hasSubmenus()) {
             $this->map($menu->getSubmenuBuilder(), $router);
             continue;
         } else {
             if (!$menu instanceof BaseMenu) {
                 throw new UnexpectedValueException("Expect menu to be an instanceof BaseMenu.");
             }
         }
         $router->group(['namespace' => $menu->getNamespace()], function ($router) use($menu) {
             $menu->registerRoutes($router);
         });
     }
 }
示例#2
0
 public function load($crudClass)
 {
     $this->crudClass = Vector::getLastSplited($crudClass, "\\");
     $this->computedMenus = MenuBuilder::getInstance()->get();
     $this->loadPageTitle();
     $this->loadPageBreadcrumbs();
     $this->loadRoutes();
 }
示例#3
0
 public function get()
 {
     $this->list = $this->build(MenuBuilder::getInstance()->get());
     return $this->list;
 }