use yii\helpers\Html; use yii\grid\GridView; use yii\bootstrap\nav; /* @var $this yii\web\View */ /* @var $searchModel app\models\CoursesSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = 'Courses'; $this->params['breadcrumbs'][] = $this->title; ?> <div class="courses-index"> <div class="row-fluid"> <div class="col-md-4"> <!--Sidebar content--> <?php echo Nav::widget(['items' => [['url' => ['/site/index'], 'label' => 'Home', 'icon' => 'home'], ['url' => ['/admin/index'], 'label' => 'Admin', 'icon' => 'book']]]); ?> </div> <div class="col-md-8"> <h1><?php echo Html::encode($this->title); ?> </h1> <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
echo Html::a(Html::img($assets->baseUrl . '/images/newmail.png', array('title' => $messages . ' ' . Yii::t('BbiiModule.bbii', 'new messages'), 'style' => 'vertical-align:bottom;')), array('message/inbox'), array('class' => 'btn btn-default')); } else { echo Html::a(Html::img($assets->baseUrl . '/images/mail.png', array('title' => Yii::t('BbiiModule.bbii', 'no new messages'), 'style' => 'vertical-align:bottom;')), array('message/inbox'), array('class' => 'btn btn-default')); } echo Html::a(Html::img($assets->baseUrl . '/images/settings.png', array('title' => Yii::t('BbiiModule.bbii', 'My settings'), 'style' => 'vertical-align:bottom;')), array('member/view', 'id' => \Yii::$app->user->identity->id), array('class' => 'btn btn-default')); echo Html::a(Html::img($assets->baseUrl . '/images/config.png', array('title' => Yii::t('BbiiModule.bbii', 'Forum settings'), 'style' => 'vertical-align:bottom;')), array('setting/index'), array('class' => 'btn btn-default')); ?> </div> <?php } ?> <h2><?php echo $this->context->module->forumTitle; ?> </h2> <br /> <div id = "nav" class="clearfix"> <?php echo Nav::widget(['items' => $item, 'options' => array('class' => 'nav nav-pills')]); ?> </div> </div> <?php if (isset($this->context->bbii_breadcrumbs)) { ?> <?php echo Breadcrumbs::widget(array('homeLink' => false, 'links' => $this->context->bbii_breadcrumbs)); ?> <!-- breadcrumbs --> <?php }
<?php // main navigation $controller = Yii::$app->controller ? Yii::$app->controller->id : null; $module = Yii::$app->controller->module ? Yii::$app->controller->module->id : null; $items = [['label' => 'Dashboard', 'url' => ['/site/index'], 'options' => ['title' => 'Dashboard'], 'active' => $controller == 'site'], ['label' => 'Projects', 'url' => ['/project/index'], 'options' => ['title' => 'Projects'], 'active' => $controller == 'project'], ['label' => 'Issues', 'url' => ['/issue/index'], 'options' => ['title' => 'Issues'], 'active' => $controller == 'issue'], ['label' => 'Activity', 'url' => ['/activity/index'], 'options' => ['title' => 'Activity'], 'active' => $controller == 'activity'], ['label' => 'Docs', 'url' => ['/docs/page'], 'options' => ['title' => 'Bugitor Documentation'], 'active' => $module == 'docs']]; if (\Yii::$app->user->can('user.admin')) { $items[] = ['label' => 'User Admin', 'url' => ['/user/admin'], 'options' => ['title' => 'User Administration'], 'active' => $module == 'user']; } if (Yii::$app->user->isGuest) { $items[] = ['label' => 'Login', 'url' => ['/user/login']]; } else { $items[] = '<li>' . Html::a('Logout', ['/user/logout'], ['data-method' => 'post']) . '</li>'; } echo Nav::widget(['id' => 'main-nav', 'encodeLabels' => false, 'options' => ['class' => 'nav navbar-nav navbar-main-menu'], 'activateItems' => true, 'activateParents' => true, 'dropDownCaret' => '<span class="caret"></span>', 'items' => $items]);
main view <?php $this->beginBody() ?> <div class="wrap"> <?php NavBar::begin([ 'brandLabel' => 'My Company', 'brandUrl' => Yii::$app->homeUrl, 'options' => [ 'class' => 'navbar-inverse navbar-fixed-top', ], ]); echo Nav::widget([ 'options' => ['class' => 'navbar-nav navbar-right'], 'items' => [ ['label' => 'Home', 'url' => ['/site/index']], ['label' => 'About', 'url' => ['/site/about']], ['label' => 'Contact', 'url' => ['/site/contact']], Yii::$app->user->isGuest ? ['label' => 'Login', 'url' => ['/site/login']] : ['label' => 'Logout (' . Yii::$app->user->identity->username . ')', ///TUTAJ NIE WIDZI USERNAME 'url' => ['/site/logout'], 'linkOptions' => ['data-method' => 'post']], ['label' => 'Register', 'url' => ['/site/register']] ], ]); NavBar::end(); ?>