84 lines
2.7 KiB
PHP
Raw Normal View History

2013-05-24 10:14:49 -04:00
<?php
/** @var yii\web\View $this */
/** @var string $content */
use app\assets\AppAsset;
2021-05-19 14:01:06 +02:00
use app\widgets\Alert;
use yii\bootstrap5\Breadcrumbs;
use yii\bootstrap5\Html;
use yii\bootstrap5\Nav;
use yii\bootstrap5\NavBar;
2013-05-24 10:14:49 -04:00
2013-11-12 06:24:07 +02:00
AppAsset::register($this);
$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'] ?? '']);
$this->registerLinkTag(['rel' => 'icon', 'type' => 'image/x-icon', 'href' => '@web/favicon.ico']);
2013-05-24 10:14:49 -04:00
?>
2013-11-28 01:19:43 +04:00
<?php $this->beginPage() ?>
2013-05-24 10:14:49 -04:00
<!DOCTYPE html>
2021-05-19 14:01:06 +02:00
<html lang="<?= Yii::$app->language ?>" class="h-100">
2013-05-24 10:14:49 -04:00
<head>
2014-03-16 10:46:16 +06:00
<title><?= Html::encode($this->title) ?></title>
<?php $this->head() ?>
2013-05-24 10:14:49 -04:00
</head>
2021-05-19 14:01:06 +02:00
<body class="d-flex flex-column h-100">
2013-11-28 01:19:43 +04:00
<?php $this->beginBody() ?>
<header id="header">
<?php
NavBar::begin([
'brandLabel' => Yii::$app->name,
'brandUrl' => Yii::$app->homeUrl,
'options' => ['class' => 'navbar-expand-md navbar-dark bg-dark fixed-top']
]);
echo Nav::widget([
2021-05-19 14:01:06 +02:00
'options' => ['class' => 'navbar-nav'],
'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 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>'
]
]);
NavBar::end();
?>
2021-05-19 14:01:06 +02:00
</header>
2013-05-24 10:14:49 -04:00
<main id="main" class="flex-shrink-0" role="main">
<div class="container">
<?php if (!empty($this->params['breadcrumbs'])): ?>
<?= Breadcrumbs::widget(['links' => $this->params['breadcrumbs']]) ?>
<?php endif ?>
2017-08-08 13:02:19 +03:00
<?= Alert::widget() ?>
<?= $content ?>
2014-03-16 10:46:16 +06:00
</div>
2021-05-19 14:01:06 +02:00
</main>
<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>
</div>
</footer>
2013-05-24 10:14:49 -04:00
2013-11-28 01:19:43 +04:00
<?php $this->endBody() ?>
2013-05-24 10:14:49 -04:00
</body>
</html>
2013-11-28 01:19:43 +04:00
<?php $this->endPage() ?>