beginPage() ?> <?= Html::encode($this->title) ?> head() ?> beginBody() ?>
Yii::$app->name, 'brandUrl' => Yii::$app->homeUrl, 'options' => [ 'class' => 'navbar-inverse navbar-fixed-top', ], ]); $menuItems = [ ['label' => '首页', 'url' => ['/site/index']], ]; if (Yii::$app->user->isGuest) { $menuItems[] = ['label' => '登入', 'url' => ['/site/login']]; } else { $menuItems[] = '
  • ' . Html::beginForm(['/site/logout'], 'post') . Html::submitButton( '退出 (' . Yii::$app->user->identity->username . ')', ['class' => 'btn btn-link logout'] ) . Html::endForm() . '
  • '; } echo Nav::widget([ 'options' => ['class' => 'navbar-nav navbar-right'], 'items' => $menuItems, ]); NavBar::end(); ?>
    isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], ]) ?>
    endBody() ?> endPage() ?>