Ejemplo n.º 1
0
 /**
  * 生成菜单用缓存
  */
 private static function buildCache()
 {
     $nodes = SystemMenu::find()->orderBy('root,lft,sort')->all();
     $array = [];
     foreach ($nodes as $node) {
         $array[$node->id] = $node->attributes;
     }
     yii::$app->cache->set(SERVER_ENV_PREFIX . ':admin_menu', $array);
     return $array;
 }
Ejemplo n.º 2
0
            <div class="pull-left info">
                <p><?php 
echo yii::$app->user->identity->username;
?>
</p>

                <a href="#"><i class="fa fa-circle text-success"></i> Online</a>
            </div>
        </div>

        <!-- search form -->
        <form action="#" method="get" class="sidebar-form">
            <div class="input-group">
                <input type="text" name="q" class="form-control" placeholder="Search..."/>
              <span class="input-group-btn">
                <button type='submit' name='search' id='search-btn' class="btn btn-flat"><i class="fa fa-search"></i>
                </button>
              </span>
            </div>
        </form>
        <!-- /.search form -->
        <?php 
$menu = \app\core\models\SystemMenu::getMenus();
?>
        <?php 
echo dmstr\widgets\Menu::widget(['options' => ['class' => 'sidebar-menu'], 'items' => $menu]);
?>
    </section>

</aside>
Ejemplo n.º 3
0
<?php

$this->title = '菜单管理';
$this->params['breadcrumbs'][] = $this->title;
/**
 * @author oba.ou
 */
// VIEW - views/product/index.php
echo \kartik\tree\TreeView::widget(['query' => \app\core\models\SystemMenu::find()->addOrderBy('root, lft , sort'), 'headingOptions' => ['label' => '菜单管理'], 'rootOptions' => ['label' => '<span class="text-primary">顶级栏目</span>'], 'fontAwesome' => true, 'isAdmin' => false, 'displayValue' => 1, 'softDelete' => false, 'cacheSettings' => ['enableCache' => true], 'showIDAttribute' => false, 'nodeAddlViews' => [\kartik\tree\Module::VIEW_PART_1 => '@app/core/modules/system/views/menu/menu-form']]);