user->isGuest) { $user = Yii::$app->user->identity->username; } else { $user = '访客'; $token = null; } /* route */ $route = $this->context->id . '/' . $this->context->action->id; if ($route == 'public/error') { $this->title = Yii::$app->errorHandler->exception->statusCode; } else { $this->title = Menu::find()->select('title')->where(['url' => $route])->scalar(); } $picAsset = $this->getAssetManager()->getBundle(AppAsset::className())->baseUrl; $logout = \yii\helpers\Url::toRoute('login/logout'); $this->beginPage() ?> 管理后台<?= ' | ' . Html::encode($this->title) ?> head() ?> beginBody() ?>
endBody() ?> endPage() ?>