Пример #1
0
 static function larakitRegisterMenuSubpages($package, $alias)
 {
     //автоматическая регистрация дочерних страниц Subpages
     $dir = base_path('vendor/' . $package . '/src/config/larakit/subpages/');
     $dir = HelperFile::normalizeFilePath($dir);
     if (file_exists($dir)) {
         $dirs = rglob('*.php', 0, $dir);
         foreach ($dirs as $d) {
             $d = str_replace($dir, '', $d);
             $d = str_replace('.php', '', $d);
             $d = trim($d, '/');
             $menus_subpages = (array) \Config::get($alias . '::larakit/subpages/' . $d);
             if (count($menus_subpages)) {
                 foreach ($menus_subpages as $page => $items) {
                     $manager = \Larakit\Widget\WidgetSubpages::factory($page);
                     foreach ($items as $as => $props) {
                         $style = Arr::get($props, 'style', 'bg-aqua');
                         $is_curtain = Arr::get($props, 'is_curtain', false);
                         $manager->add($as, $style, $is_curtain);
                     }
                 }
             }
         }
     }
 }
Пример #2
0
 static function larakitRegisterMenuSubpages($alias, $entity)
 {
     //автоматическая регистрация дочерних страниц Subpages
     $menus_subpages = (array) \Config::get($alias . '::models/' . $entity . '/menus_subpages');
     if (count($menus_subpages)) {
         foreach ($menus_subpages as $page => $items) {
             $manager = \Larakit\Widget\WidgetSubpages::factory($page);
             foreach ($items as $as => $props) {
                 $style = Arr::get($props, 'style', 'bg-aqua');
                 $is_curtain = Arr::get($props, 'is_curtain', false);
                 $manager->add($as, $style, $is_curtain);
             }
         }
     }
 }
Пример #3
0
 function toHtml()
 {
     $children = array_merge($this->children, WidgetSubpages::factory('*')->getChilds());
     return \View::make($this->tpl(), ['children' => $children])->__toString();
 }