改进导航栏和首页

This commit is contained in:
Chenx221 2024-02-10 12:03:11 +08:00
parent dcdecdad7d
commit efaecee9ca
2 changed files with 10 additions and 6 deletions

View File

@ -33,16 +33,20 @@ $this->registerLinkTag(['rel' => 'icon', 'type' => 'image/x-icon', 'href' => Yii
<header id="header"> <header id="header">
<?php <?php
NavBar::begin([ NavBar::begin([
'brandLabel' => '未命名的站点', 'brandLabel' => '网盘',
'brandUrl' => Yii::$app->homeUrl, 'brandUrl' => Yii::$app->homeUrl,
'options' => ['class' => 'navbar-expand-md navbar-dark bg-dark fixed-top'] 'options' => ['class' => 'navbar-expand-md navbar-dark bg-dark fixed-top']
]); ]);
echo Nav::widget([ echo Nav::widget([
'options' => ['class' => 'navbar-nav'], 'options' => ['class' => 'navbar-nav'],
'items' => [ 'items' => [
['label' => '主页', 'url' => ['/site/index']], ['label' => '首页', 'url' => ['/site/index']],
['label' => 'About', 'url' => ['/site/about']], ['label' => '文件', 'url' => ['/site/about']],
['label' => 'Contact', 'url' => ['/site/contact']], ['label' => '分享', 'url' => ['/site/about']],
['label' => '个人设置', 'url' => ['/site/about']],
['label' => '系统设置', 'url' => ['/site/contact']],
['label' => '客户端下载', 'url' => ['/site/contact']],
['label' => 'API', 'url' => ['/site/about']],
Yii::$app->user->isGuest Yii::$app->user->isGuest
? ['label' => '登录', 'url' => ['/user/login']] ? ['label' => '登录', 'url' => ['/user/login']]
: '<li class="nav-item">' : '<li class="nav-item">'

View File

@ -7,9 +7,9 @@ $this->title = 'My Yii Application';
<div class="site-index"> <div class="site-index">
<div class="jumbotron text-center bg-transparent mt-5 mb-5"> <div class="jumbotron text-center bg-transparent mt-5 mb-5">
<h1 class="display-4">Congratulations!</h1> <h1 class="display-4">这里是网盘的首页</h1>
<p class="lead">You have successfully created your Yii-powered application.</p> <p class="lead">内容还在建设中</p>
<p><a class="btn btn-lg btn-success" href="https://www.yiiframework.com">Get started with Yii</a></p> <p><a class="btn btn-lg btn-success" href="https://www.yiiframework.com">Get started with Yii</a></p>
</div> </div>