Ejemplo n.º 1
0
 /**
  * Register the Menu Generator instance
  */
 protected function registerMenuGenerator()
 {
     $this->app->bind('menu', function ($app) {
         $this->loadConfigurationOptions();
         $menu = new MenuGenerator($app['url'], $app['config'], $this->getTheme());
         if ($this->options['control_access']) {
             $menu->setAccessHandler($app[AccessHandler::class]);
         }
         if ($this->options['translate_texts']) {
             $menu->setLang($app['translator']);
         }
         return $menu;
     });
 }
Ejemplo n.º 2
0
 /**
  * Returns true if the $accessHandler is not set, otherwise it relies on the
  * handler implementation to check if the user should has access or not.
  *
  * @param array $options
  * @return bool 
  * @static 
  */
 public static function checkAccess($options)
 {
     return \Styde\Html\Menu\MenuGenerator::checkAccess($options);
 }