Ejemplo n.º 1
0
 public function init()
 {
     parent::init();
     $this->_menus = Data::cache(MenuModel::CACHE_KEY, 3600, function () {
         return MenuModel::find()->asArray()->all();
     });
 }
Ejemplo n.º 2
0
 public static function getItems()
 {
     $items = [];
     $menuItems = Menu::find()->sort()->all();
     if (is_array($menuItems)) {
         foreach ($menuItems as $item) {
             $items[] = ['label' => $item->label, 'url' => $item->url];
         }
     } else {
     }
     return $items;
 }
Ejemplo n.º 3
0
            <div class="tab-pane" id="tab_2">
                <?php 
echo $form->field($model, 'where_to_place')->dropDownList(\app\modules\text\models\Text::getWereToPlace());
?>

                <div class="form-group field-text-links">
                    <label class="col-md-3 control-label" for="text-links"><?php 
echo Yii::t('text', 'Links');
?>
</label>
                    <div class="col-md-9">
                        <div class="checkbox well well-sm">
                            <div class="container-fluid">
                                <div class="row">
                                    <?php 
$menus = \app\modules\menu\models\Menu::find()->all();
foreach ($menus as $menu) {
    $cats = \app\modules\menu\models\MenuItems::cats($menu->id);
    ?>
                                        <div class="col-sm-6">
                                            <b><?php 
    echo $menu->title;
    ?>
</b><br>
                                            <?php 
    foreach ($cats as $cat) {
        ?>
                                                <label style="padding-left:  <?php 
        echo $cat->depth * 20;
        ?>
px;">
Ejemplo n.º 4
0
 public function actionIndex()
 {
     $data = new ActiveDataProvider(['query' => Menu::find()->sort()]);
     return $this->render('index', ['data' => $data]);
 }