Exemple #1
0
?>
/img/user2-160x160.jpg" class="img-circle" alt="User Image"/>
            </div>
            <div class="pull-left info">
                <p>Alexander Pierce</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 -->

        <!-- sidebar menu: : style can be found in sidebar.less -->
        <?php 
echo Menu::widget(['options' => ['class' => 'sidebar-menu'], 'encodeLabels' => false, 'activateParents' => true, 'items' => [['label' => '<span>' . 'Menu Yii2' . '</span>', 'options' => ['class' => 'header']], ['label' => '<span>' . 'Gii' . '</span>', 'icon' => 'fa fa-file-code-o', 'url' => ['/gii']], ['label' => '<span>' . 'Debug' . '</span>', 'icon' => 'fa fa-dashboard', 'url' => ['/debug']], ['label' => '<span>' . 'Login' . '</span>', 'url' => ['site/login'], 'visible' => Yii::$app->user->isGuest], ['label' => '<span>' . 'Same tools' . '</span>', 'icon' => 'fa fa-share', 'url' => '#', 'items' => [['label' => '<span>' . 'Gii' . '</span>', 'icon' => 'fa fa-file-code-o', 'url' => ['/gii']], ['label' => '<span>' . 'Debug' . '</span>', 'icon' => 'fa fa-dashboard', 'url' => ['/debug']], ['label' => '<span>' . 'Level One' . '</span>', 'icon' => 'fa fa-circle-o', 'url' => '#', 'items' => [['label' => '<span>' . 'Level Two' . '</span>', 'icon' => 'fa fa-circle-o', 'url' => '#'], ['label' => '<span>' . 'Level Two' . '</span>', 'icon' => 'fa fa-circle-o', 'url' => '#', 'items' => [['label' => '<span>' . 'Level Three' . '</span>', 'icon' => 'fa fa-circle-o', 'url' => '#'], ['label' => '<span>' . 'Level Three' . '</span>', 'icon' => 'fa fa-circle-o', 'url' => '#']]]]]]]]]);
?>

    </section>
    <!-- /.sidebar -->
</aside>
<?php

/**
 * Sidebar menu layout.
 *
 * @var \yii\web\View $this View
 */
use mistim\theme\adminlte\widgets\Menu;
$controller = Yii::$app->controller;
echo Menu::widget(['options' => ['class' => 'sidebar-menu'], 'encodeLabels' => false, 'activateParents' => true, 'items' => [['label' => Yii::t('admin', 'MAIN NAVIGATION'), 'options' => ['class' => 'header']], ['label' => '<span>' . Yii::t('admin', 'Dashboard') . '</span>', 'url' => '/admin', 'icon' => 'fa-dashboard', 'visible' => Yii::$app->user->can('/admin/main/index') || Yii::$app->user->can('/admin/*'), 'active' => $controller->id === 'main'], ['label' => '<span>' . Yii::t('admin', 'Administrators') . '</span>', 'url' => '/admin/administrator', 'icon' => 'fa-street-view', 'active' => $controller->id === 'administrator', 'visible' => Yii::$app->user->can('/admin/administrator/index') || Yii::$app->user->can('/admin/*')], ['label' => '<span>' . Yii::t('admin', 'Access rules') . '</span>', 'url' => '#', 'icon' => 'fa-user-secret', 'option' => 'treeview', 'visible' => Yii::$app->user->can('/admin/rbac/assignment/index') || Yii::$app->user->can('/admin/rbac/role/index') || Yii::$app->user->can('/admin/rbac/permission/index') || Yii::$app->user->can('/admin/rbac/route/index') || Yii::$app->user->can('/admin/rbac/rule/index') || Yii::$app->user->can('/admin/rbac/*'), 'items' => [['label' => Yii::t('admin', 'Assignment'), 'url' => ['/admin/rbac/assignment'], 'active' => $controller->id === 'assignment', 'visible' => Yii::$app->user->can('/admin/rbac/assignment/index') || Yii::$app->user->can('/admin/rbac/*')], ['label' => Yii::t('admin', 'Role'), 'url' => ['/admin/rbac/role'], 'active' => $controller->id === 'role', 'visible' => Yii::$app->user->can('/admin/rbac/role/index') || Yii::$app->user->can('/admin/rbac/*')], ['label' => Yii::t('admin', 'Permission'), 'url' => ['/admin/rbac/permission'], 'active' => $controller->id === 'permission', 'visible' => Yii::$app->user->can('/admin/rbac/permission/index') || Yii::$app->user->can('/admin/rbac/*')], ['label' => Yii::t('admin', 'Route'), 'url' => ['/admin/rbac/route'], 'active' => $controller->id === 'route', 'visible' => Yii::$app->user->can('/admin/rbac/route/index') || Yii::$app->user->can('/admin/rbac/*')], ['label' => Yii::t('admin', 'Rule'), 'url' => ['/admin/rbac/rule'], 'active' => $controller->id === 'rule', 'visible' => Yii::$app->user->can('/admin/rbac/rule/index') || Yii::$app->user->can('/admin/rbac/*')]]], ['label' => '<span>' . Yii::t('admin', 'Settings') . '</span>', 'url' => ['/admin/setting'], 'icon' => 'fa-cogs', 'active' => $controller->id === 'setting', 'visible' => Yii::$app->user->can('/admin/setting/index') || Yii::$app->user->can('/admin/*')], ['label' => '<span>' . Yii::t('admin', 'Translations') . '</span>', 'url' => '#', 'icon' => 'fa-language', 'option' => 'treeview', 'visible' => Yii::$app->user->can('/admin/language/index') || Yii::$app->user->can('/admin/translation-admin/index') || Yii::$app->user->can('/admin/translation-public/index') || Yii::$app->user->can('/admin/*'), 'items' => [['label' => Yii::t('admin', 'Languages'), 'url' => ['/admin/language'], 'active' => $controller->id === 'language', 'visible' => Yii::$app->user->can('/admin/language/index') || Yii::$app->user->can('/admin/*')], ['label' => Yii::t('admin', 'Translation admin'), 'url' => ['/admin/translation-admin'], 'active' => $controller->id === 'translation-admin', 'visible' => Yii::$app->user->can('/admin/translation-admin/index') || Yii::$app->user->can('/admin/*')], ['label' => Yii::t('admin', 'Translation public'), 'url' => ['/admin/translation-public'], 'active' => $controller->id === 'translation-public', 'visible' => Yii::$app->user->can('/admin/translation-public/index') || Yii::$app->user->can('/admin/*')]]]]]);