/**
  * add default menus
  */
 protected function addDefaultData()
 {
     $items = [['label' => 'Home', 'url' => '/site/index', 'position' => 'header'], ['label' => 'Blog', 'url' => '/blog/index', 'position' => 'header']];
     foreach ($items as $i => $item) {
         $menu = new \common\models\Menu();
         $menu->label = $item['label'];
         $menu->url = $item['url'];
         $menu->position = $item['position'];
         $menu->order = $i;
         $menu->status = \common\models\Menu::STATUS_ACTIVE;
         $menu->save();
     }
 }
Exemple #2
0
                    <h2>Danh mục</h2>
                    <ul class="nav navbar-right panel_toolbox text-right">
                        <li class="pull-right"><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
                    </ul>
                    <div class="clearfix"></div>
                </div>
                <div class="x_content" style="display:none">
                    <ul class="nav">
                        <?php 
if (!empty($category)) {
    foreach ($category as $value) {
        ?>
                                <li>
                                    <div class="checkbox">
                                        <?php 
        echo common\models\Menu::getIndent($value['indent']);
        ?>
                                        <label>
                                            <input type="checkbox" value="">
                                            <?php 
        echo $value['title'];
        ?>
                                        </label>
                                    </div>
                                </li>
                                <?php 
    }
}
?>
                    </ul>
                </div>