修改页脚

This commit is contained in:
Chenx221 2024-02-09 14:14:45 +08:00
parent c066f92a33
commit eb6cf82904

View File

@ -1,6 +1,7 @@
<?php
/** @var yii\web\View $this */
/** @var string $content */
use app\assets\AppAsset;
@ -32,26 +33,26 @@ $this->registerLinkTag(['rel' => 'icon', 'type' => 'image/x-icon', 'href' => Yii
<header id="header">
<?php
NavBar::begin([
'brandLabel' => Yii::$app->name,
'brandLabel' => '未命名的站点',
'brandUrl' => Yii::$app->homeUrl,
'options' => ['class' => 'navbar-expand-md navbar-dark bg-dark fixed-top']
]);
echo Nav::widget([
'options' => ['class' => 'navbar-nav'],
'items' => [
['label' => 'Home', 'url' => ['/site/index']],
['label' => '主页', 'url' => ['/site/index']],
['label' => 'About', 'url' => ['/site/about']],
['label' => 'Contact', 'url' => ['/site/contact']],
Yii::$app->user->isGuest
? ['label' => 'Login', 'url' => ['/site/login']]
? ['label' => '登录', 'url' => ['/user/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>'
. Html::beginForm(['/user/logout'])
. Html::submitButton(
'Logout (' . Yii::$app->user->identity->username . ')',
['class' => 'nav-link btn btn-link logout']
)
. Html::endForm()
. '</li>'
]
]);
NavBar::end();
@ -71,8 +72,11 @@ $this->registerLinkTag(['rel' => 'icon', 'type' => 'image/x-icon', 'href' => Yii
<footer id="footer" class="mt-auto py-3 bg-light">
<div class="container">
<div class="row text-muted">
<div class="col-md-6 text-center text-md-start">&copy; My Company <?= date('Y') ?></div>
<div class="col-md-6 text-center text-md-end"><?= Yii::powered() ?></div>
<div class="col-md-6 text-center text-md-start"><?php echo '&copy; Created & Design by ' . '<a href="https://blog.chenx221.cyou" rel="external">Chenx221</a> | 2024 - ' . date('Y') ?></div>
<div class="col-md-6 text-center text-md-end"><?= Yii::t('yii', 'Powered by {yii}', [
'yii' => '<a href="https://www.yiiframework.com/" rel="external">' . \Yii::t('yii',
'Yii Framework') . '</a>',
]) ?></div>
</div>
</div>
</footer>