2013-05-24 22:14:49 +08:00
|
|
|
<?php
|
2015-07-09 17:47:20 +08:00
|
|
|
|
2022-01-15 03:47:17 +08:00
|
|
|
/** @var yii\web\View $this */
|
|
|
|
/** @var string $content */
|
2015-07-09 17:47:20 +08:00
|
|
|
|
2013-11-14 00:17:05 +08:00
|
|
|
use app\assets\AppAsset;
|
2021-05-19 20:01:06 +08:00
|
|
|
use app\widgets\Alert;
|
2022-06-18 00:15:52 +08:00
|
|
|
use yii\bootstrap5\Breadcrumbs;
|
|
|
|
use yii\bootstrap5\Html;
|
|
|
|
use yii\bootstrap5\Nav;
|
|
|
|
use yii\bootstrap5\NavBar;
|
2013-05-24 22:14:49 +08:00
|
|
|
|
2013-11-12 12:24:07 +08:00
|
|
|
AppAsset::register($this);
|
2022-08-19 05:57:02 +08:00
|
|
|
|
|
|
|
$this->registerCsrfMetaTags();
|
|
|
|
$this->registerMetaTag(['charset' => Yii::$app->charset], 'charset');
|
|
|
|
$this->registerMetaTag(['name' => 'viewport', 'content' => 'width=device-width, initial-scale=1, shrink-to-fit=no']);
|
|
|
|
$this->registerMetaTag(['name' => 'description', 'content' => $this->params['meta_description'] ?? '']);
|
|
|
|
$this->registerMetaTag(['name' => 'keywords', 'content' => $this->params['meta_keywords'] ?? '']);
|
2022-08-24 22:33:32 +08:00
|
|
|
$this->registerLinkTag(['rel' => 'icon', 'type' => 'image/x-icon', 'href' => Yii::getAlias('@web/favicon.ico')]);
|
2013-05-24 22:14:49 +08:00
|
|
|
?>
|
2013-11-28 05:19:43 +08:00
|
|
|
<?php $this->beginPage() ?>
|
2013-05-24 22:14:49 +08:00
|
|
|
<!DOCTYPE html>
|
2021-05-19 20:01:06 +08:00
|
|
|
<html lang="<?= Yii::$app->language ?>" class="h-100">
|
2013-05-24 22:14:49 +08:00
|
|
|
<head>
|
2014-03-16 12:46:16 +08:00
|
|
|
<title><?= Html::encode($this->title) ?></title>
|
|
|
|
<?php $this->head() ?>
|
2013-05-24 22:14:49 +08:00
|
|
|
</head>
|
2021-05-19 20:01:06 +08:00
|
|
|
<body class="d-flex flex-column h-100">
|
2013-11-28 05:19:43 +08:00
|
|
|
<?php $this->beginBody() ?>
|
2015-07-09 17:47:20 +08:00
|
|
|
|
2022-08-19 05:57:02 +08:00
|
|
|
<header id="header">
|
2015-07-09 17:47:20 +08:00
|
|
|
<?php
|
|
|
|
NavBar::begin([
|
2017-09-22 00:01:41 +08:00
|
|
|
'brandLabel' => Yii::$app->name,
|
2015-07-09 17:47:20 +08:00
|
|
|
'brandUrl' => Yii::$app->homeUrl,
|
2022-08-19 05:57:02 +08:00
|
|
|
'options' => ['class' => 'navbar-expand-md navbar-dark bg-dark fixed-top']
|
2015-07-09 17:47:20 +08:00
|
|
|
]);
|
|
|
|
echo Nav::widget([
|
2021-05-19 20:01:06 +08:00
|
|
|
'options' => ['class' => 'navbar-nav'],
|
2015-07-09 17:47:20 +08:00
|
|
|
'items' => [
|
|
|
|
['label' => 'Home', 'url' => ['/site/index']],
|
|
|
|
['label' => 'About', 'url' => ['/site/about']],
|
|
|
|
['label' => 'Contact', 'url' => ['/site/contact']],
|
2022-08-19 05:57:02 +08:00
|
|
|
Yii::$app->user->isGuest
|
|
|
|
? ['label' => 'Login', 'url' => ['/site/login']]
|
|
|
|
: '<li class="nav-item">'
|
|
|
|
. Html::beginForm(['/site/logout'])
|
|
|
|
. Html::submitButton(
|
|
|
|
'Logout (' . Yii::$app->user->identity->username . ')',
|
|
|
|
['class' => 'nav-link btn btn-link logout']
|
|
|
|
)
|
|
|
|
. Html::endForm()
|
|
|
|
. '</li>'
|
|
|
|
]
|
2015-07-09 17:47:20 +08:00
|
|
|
]);
|
|
|
|
NavBar::end();
|
|
|
|
?>
|
2021-05-19 20:01:06 +08:00
|
|
|
</header>
|
2013-05-24 22:14:49 +08:00
|
|
|
|
2022-08-19 05:57:02 +08:00
|
|
|
<main id="main" class="flex-shrink-0" role="main">
|
2015-07-09 17:47:20 +08:00
|
|
|
<div class="container">
|
2022-08-19 05:57:02 +08:00
|
|
|
<?php if (!empty($this->params['breadcrumbs'])): ?>
|
|
|
|
<?= Breadcrumbs::widget(['links' => $this->params['breadcrumbs']]) ?>
|
|
|
|
<?php endif ?>
|
2017-08-08 18:02:19 +08:00
|
|
|
<?= Alert::widget() ?>
|
2015-07-09 17:47:20 +08:00
|
|
|
<?= $content ?>
|
2014-03-16 12:46:16 +08:00
|
|
|
</div>
|
2021-05-19 20:01:06 +08:00
|
|
|
</main>
|
2015-07-09 17:47:20 +08:00
|
|
|
|
2022-08-19 05:57:02 +08:00
|
|
|
<footer id="footer" class="mt-auto py-3 bg-light">
|
2015-07-09 17:47:20 +08:00
|
|
|
<div class="container">
|
2022-08-19 05:57:02 +08:00
|
|
|
<div class="row text-muted">
|
|
|
|
<div class="col-md-6 text-center text-md-start">© My Company <?= date('Y') ?></div>
|
|
|
|
<div class="col-md-6 text-center text-md-end"><?= Yii::powered() ?></div>
|
|
|
|
</div>
|
2015-07-09 17:47:20 +08:00
|
|
|
</div>
|
|
|
|
</footer>
|
2013-05-24 22:14:49 +08:00
|
|
|
|
2013-11-28 05:19:43 +08:00
|
|
|
<?php $this->endBody() ?>
|
2013-05-24 22:14:49 +08:00
|
|
|
</body>
|
|
|
|
</html>
|
2013-11-28 05:19:43 +08:00
|
|
|
<?php $this->endPage() ?>
|