Beispiel #1
0
$menuItems = [['encode' => false, 'label' => '<i class="fa fa-home"></i>', 'url' => ['/site/index']], ['type' => 'messages', 'label' => '#', 'url' => ['/messages/index'], 'items' => [['label' => 'Support Team', 'url' => ['/messages/view', 'id' => 1], 'image' => Url::to('adminlte/img/user2-160x160.jpg'), 'description' => 'Why not buy a new awesome theme?', 'time' => '5 mins'], ['label' => 'Marketing Team', 'url' => ['/messages/view', 'id' => 2], 'image' => Url::to('adminlte/img/user2-160x160.jpg'), 'description' => 'Why not buy a new awesome server?', 'time' => '2 mins']]], ['type' => 'notifications', 'label' => '#', 'url' => ['/notifications/index'], 'items' => [['label' => 'Support Team', 'url' => ['/notifications/view', 'id' => 1]], ['label' => 'Support Team', 'url' => ['/notifications/view', 'id' => 3]], ['label' => 'Support Team', 'url' => ['/notifications/view', 'id' => 4]], ['label' => 'Support Team', 'url' => ['/notifications/view', 'id' => 2]], ['label' => 'Support Team', 'url' => ['/notifications/view', 'id' => 2]], ['label' => 'Support Team', 'url' => ['/notifications/view', 'id' => 2]], ['label' => 'Support Team', 'url' => ['/notifications/view', 'id' => 2]], ['label' => 'Support Team', 'url' => ['/notifications/view', 'id' => 2]]]], ['type' => 'tasks', 'label' => '#', 'url' => ['/tasks/index'], 'items' => [['label' => 'Migration', 'url' => ['/tasks/view', 'id' => 1], 'color' => 'aqua', 'percent' => '10'], ['label' => 'Backup', 'url' => ['/tasks/view', 'id' => 1], 'color' => 'red', 'percent' => '75'], ['label' => 'Analyze', 'url' => ['/tasks/view', 'id' => 1], 'color' => 'yellow', 'percent' => '25'], ['label' => 'Tutorial', 'url' => ['/tasks/view', 'id' => 1], 'color' => 'lime', 'percent' => '50']]], ['label' => 'Page', 'url' => '#', 'items' => [['label' => 'Contact', 'url' => ['/site/contact']], ['label' => 'About', 'url' => ['/site/about']]]]];
if (Yii::$app->user->isGuest) {
    $menuItems[] = ['label' => 'Signup', 'url' => ['/site/signup']];
    $menuItems[] = ['label' => 'Login', 'url' => ['/site/login']];
} else {
    $menuItems[] = ['type' => 'user', 'label' => '#', 'url' => ['/tasks/index'], 'logoutUrl' => ['/site/logout'], 'profileUrl' => ['/site/profile'], 'image' => Url::to('adminlte/img/user2-160x160.jpg'), 'username' => Yii::$app->user->identity->username, 'position' => 'User', 'join' => 'Member since ' . date('m,Y', Yii::$app->user->identity->created_at), 'items' => []];
    /*
    				$menuItems[] = [
    					'label' => 'Logout (' . Yii::$app->user->identity->username . ')',
    					
    					'linkOptions' => ['data-method' => 'post']
    				];*/
}
$menuItems[] = ['type' => 'control', 'label' => '#', 'url' => '#'];
echo Nav::widget(['options' => ['class' => 'navbar-nav'], 'items' => $menuItems]);
NavBar::end();
?>
        

      <!-- =============================================== -->
	
      <!-- Left side column. contains the sidebar -->
		<?php 
$user = [];
if (!Yii::$app->user->isGuest) {
    $user['image'] = Url::to('adminlte/img/user2-160x160.jpg');
    $user['username'] = Yii::$app->user->identity->username;
}
SideNavBar::begin(['user' => $user, 'search' => ['method' => 'post', 'action' => Url::to(['site/search'])], 'options' => ['class' => 'navbar-static-top']]);
$menuItems = [['label' => 'Dashboard', 'url' => '#', 'icon' => 'fa fa-dashboard'], ['label' => 'Layouts Options', 'url' => '#', 'icon' => 'fa fa-files-o'], ['label' => 'Widgets', 'url' => ['site/widgets'], 'icon' => 'fa fa-th'], ['label' => 'Charts', 'url' => ['site/charts'], 'icon' => 'fa fa-pie-chart'], ['label' => 'UI Elements', 'url' => '#', 'icon' => 'fa fa-laptop'], ['label' => 'Forms', 'url' => '#', 'icon' => 'fa fa-edit'], ['label' => 'Tables', 'url' => '#', 'icon' => 'fa fa-table'], ['label' => 'Calendar', 'url' => '#', 'icon' => 'fa fa-calendar'], ['label' => 'Mailbox', 'url' => '#', 'icon' => 'fa fa-envelope'], ['label' => 'Examples', 'url' => '#', 'icon' => 'fa fa-folder'], ['label' => 'Multilevel', 'url' => '#', 'icon' => 'fa fa-share', 'items' => [['label' => 'Level', 'url' => '#', 'icon' => 'fa fa-angle-right'], ['label' => 'Level', 'url' => '#', 'icon' => 'fa fa-angle-right', 'items' => [['label' => 'Sub Level', 'url' => '#', 'icon' => 'fa fa-angle-right'], ['label' => 'Sub Level', 'url' => '#', 'icon' => 'fa fa-angle-right', 'items' => [['label' => 'Sub Level', 'url' => '#', 'icon' => 'fa fa-angle-right'], ['label' => 'Sub Level', 'url' => '#', 'icon' => 'fa fa-angle-right'], ['label' => 'Sub Level', 'url' => '#', 'icon' => 'fa fa-angle-right']]], ['label' => 'Sub Level', 'url' => '#', 'icon' => 'fa fa-angle-right']]], ['label' => 'Level', 'url' => '#', 'icon' => 'fa fa-angle-right']]], ['label' => 'Documentation', 'url' => '#', 'icon' => 'fa fa-book']];
echo SideNav::widget(['header' => 'MAIN NAVIGATION', 'options' => ['class' => 'sidebar-menu'], 'items' => $menuItems]);
Beispiel #2
0
    <!-- end header -->

    <!-- start navigation -->
    <nav class="main-navigation">
        <div class="container">
            <div class="row">
                <div class="col-sm-12">
                    <div class="navbar-header">
                        <span class="nav-toggle-button collapsed" data-toggle="collapse" data-target="#main-menu">
                        <span class="sr-only">Toggle navigation</span>
                        <i class="fa fa-bars"></i>
                        </span>
                    </div>
                    <div class="collapse navbar-collapse" id="main-menu">
                        <?php 
echo \frontend\widgets\NavBar::widget();
?>
                    </div>
                </div>
            </div>
        </div>
    </nav>
    <!-- end navigation -->

    <!-- start site's main content area -->
    <section class="content-wrap">
    <div class="container">
    <div class="row">

    <main class="col-md-8 main-content">
        <?php