Exemplo n.º 1
0
<?php

use app\modules\admin\widgets\Menu;
echo Menu::widget(['items' => [['class' => 'active', 'url' => ['/admin/dashboard/index'], 'label' => '<i class="glyphicon glyphicon-dashboard"></i> ' . Yii::t('app', 'Dashboard'), 'scope' => ['dashboard']], ['class' => 'active', 'url' => ['/admin/category/list'], 'label' => '<i class="glyphicon glyphicon-align-justify"></i> ' . Yii::t('app', 'Catalog'), 'scope' => ['category', 'product']], ['class' => 'active', 'url' => ['/admin/page/list'], 'label' => '<i class="glyphicon glyphicon-file"></i> ' . Yii::t('app', 'Pages'), 'scope' => ['page']], ['class' => 'active', 'url' => ['/admin/order/list'], 'label' => '<i class="glyphicon glyphicon-th-list"></i> ' . Yii::t('app', 'Orders'), 'scope' => ['order', 'order-items']], ['class' => 'active', 'url' => ['/admin/comment/list'], 'label' => '<i class="glyphicon glyphicon-comment"></i> ' . Yii::t('app', 'Comments'), 'scope' => ['comment']], ['class' => 'active', 'url' => ['/admin/news-items/list'], 'label' => '<i class="glyphicon glyphicon-list-alt"></i> ' . Yii::t('app', 'News'), 'scope' => ['news-items']], ['class' => 'active', 'url' => ['/admin/currency/list'], 'label' => '<i class="glyphicon glyphicon-rub"></i> ' . Yii::t('app', 'Currencies'), 'scope' => ['currency']], ['class' => 'active', 'url' => ['/admin/settings/index'], 'label' => '<i class="glyphicon glyphicon-cog"></i> ' . Yii::t('app', 'Settings'), 'scope' => ['settings']]], 'encodeLabels' => false, 'options' => ['class' => 'sidebar-nav']]);
Exemplo n.º 2
0
 * @var View $this
 * @var User $current_user
 */
$current_url = Url::current();
$current_user = Yii::$app->user->identity;
?>
<aside class="main-sidebar">
    <section class="sidebar">
        <div class="user-panel">
            <div class="pull-left image">
                <img src="<?php 
echo XUtils::getAvatar($current_user->email);
?>
" class="img-circle" alt="<?php 
echo $current_user->nickname;
?>
">
            </div>
            <div class="pull-left info">
                <p><?php 
echo $current_user->nickname;
?>
</p>
                <a href="#"><i class="fa fa-circle text-success"></i> Online</a>
            </div>
        </div>
        <?php 
echo Menu::widget(['options' => ['class' => 'sidebar-menu'], 'encodeLabels' => false, 'items' => [['label' => '<span>管理首页</span>', 'url' => ['default/index'], 'icon' => 'fa fa-dashboard', 'active' => $current_url === Url::to(['default/index'])], ['label' => '<span>文章管理</span>', 'url' => ['post/index'], 'icon' => 'fa fa-list'], ['label' => '<span>分类管理</span>', 'url' => ['category/index'], 'icon' => 'fa fa-folder-open'], ['label' => '<span>留言管理</span>', 'url' => ['comment/index'], 'icon' => 'fa fa-comment'], ['label' => '<span>用户管理</span>', 'url' => ['user/index'], 'icon' => 'fa fa-user'], ['label' => '<span>导航</span>', 'url' => ['nav/index'], 'icon' => 'fa fa-map-marker'], ['label' => '<span>操作日志</span>', 'url' => ['log/index'], 'icon' => 'fa fa-paw'], ['label' => '<span>设置</span>', 'options' => ['class' => 'header']], ['label' => '<span>系统配置</span>', 'url' => ['config/index'], 'icon' => 'fa fa-cogs', 'options' => ['class' => 'treeview'], 'items' => [['label' => '<span>基本设置</span>', 'url' => ['config/setting'], 'icon' => 'fa fa-cog'], ['label' => '<span>缓存管理</span>', 'url' => ['config/cache'], 'icon' => 'fa fa-refresh'], ['label' => '<span>SEO 设置</span>', 'url' => ['config/seo'], 'icon' => 'fa fa-google']]]]]);
?>
    </section>
</aside>