yii2-netdisk/views/layouts/main.php

82 lines
2.2 KiB
PHP
Raw Normal View History

2013-05-24 22:14:49 +08:00
<?php
/* @var $this \yii\web\View */
/* @var $content string */
2017-08-08 18:02:19 +08:00
use app\widgets\Alert;
2013-05-24 22:14:49 +08:00
use yii\helpers\Html;
2013-08-12 19:17:43 +08:00
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
2013-05-24 22:14:49 +08:00
use yii\widgets\Breadcrumbs;
use app\assets\AppAsset;
2013-05-24 22:14:49 +08:00
2013-11-12 12:24:07 +08:00
AppAsset::register($this);
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>
<html lang="<?= Yii::$app->language ?>">
2013-05-24 22:14:49 +08:00
<head>
<meta charset="<?= Yii::$app->charset ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
2014-03-16 12:46:16 +08:00
<meta name="viewport" content="width=device-width, initial-scale=1">
<?= Html::csrfMetaTags() ?>
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>
<body>
2013-11-28 05:19:43 +08:00
<?php $this->beginBody() ?>
<div class="wrap">
<?php
NavBar::begin([
'brandLabel' => Yii::$app->name,
'brandUrl' => Yii::$app->homeUrl,
'options' => [
'class' => 'navbar-inverse navbar-fixed-top',
],
]);
echo Nav::widget([
'options' => ['class' => 'navbar-nav navbar-right'],
'items' => [
['label' => 'Home', 'url' => ['/site/index']],
['label' => 'About', 'url' => ['/site/about']],
['label' => 'Contact', 'url' => ['/site/contact']],
Yii::$app->user->isGuest ? (
['label' => 'Login', 'url' => ['/site/login']]
) : (
'<li>'
2016-10-14 06:13:07 +08:00
. Html::beginForm(['/site/logout'], 'post')
. Html::submitButton(
'Logout (' . Yii::$app->user->identity->username . ')',
2016-10-14 06:13:07 +08:00
['class' => 'btn btn-link logout']
)
. Html::endForm()
. '</li>'
)
],
]);
NavBar::end();
?>
2013-05-24 22:14:49 +08:00
<div class="container">
<?= Breadcrumbs::widget([
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
]) ?>
2017-08-08 18:02:19 +08:00
<?= Alert::widget() ?>
<?= $content ?>
2014-03-16 12:46:16 +08:00
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-left">&copy; My Company <?= date('Y') ?></p>
2013-05-24 22:14:49 +08:00
<p class="pull-right"><?= Yii::powered() ?></p>
</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() ?>