Advertisement
ganryu

main.php

Feb 8th, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.21 KB | None | 0 0
  1. <?php
  2.  
  3. /* @var $this \yii\web\View */
  4. /* @var $content string */
  5.  
  6. use app\widgets\Alert;
  7. use yii\helpers\Html;
  8. use yii\bootstrap\Nav;
  9. use yii\bootstrap\NavBar;
  10. use yii\widgets\Breadcrumbs;
  11. use app\assets\AppAsset;
  12.  
  13. AppAsset::register($this);
  14. ?>
  15. <?php $this->beginPage() ?>
  16. <!DOCTYPE html>
  17. <html lang="<?= Yii::$app->language ?>">
  18. <head>
  19.     <meta charset="<?= Yii::$app->charset ?>">
  20.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  21.     <meta name="viewport" content="width=device-width, initial-scale=1">
  22.     <?= Html::csrfMetaTags() ?>
  23.     <title><?= Html::encode($this->title) ?></title>
  24.     <?php $this->head() ?>
  25. </head>
  26. <body>
  27. <?php $this->beginBody() ?>
  28.  
  29. <div class="wrap">
  30.     <?php
  31.     NavBar::begin([
  32.         'brandLabel' => Yii::$app->name,
  33.         'brandUrl' => Yii::$app->homeUrl,
  34.         'options' => [
  35.             'class' => 'navbar-inverse navbar-fixed-top',
  36.         ],
  37.     ]);
  38.     echo Nav::widget([
  39.         'options' => ['class' => 'navbar-nav navbar-right'],
  40.         'items' => [
  41.             ['label' => 'Home', 'url' => ['/site/index']],
  42.             ['label' => 'About', 'url' => ['/site/about']],
  43.             ['label' => 'Contact', 'url' => ['/site/contact']],
  44.             Yii::$app->user->isGuest ?
  45.                 ['label' => 'Sign in', 'url' => ['/user/security/login']] :
  46.                 ['label' => 'Sign out (' . Yii::$app->user->identity->username . ')',
  47.                     'url' => ['/user/security/logout'],
  48.                     'linkOptions' => ['data-method' => 'post']],
  49.             ['label' => 'Register', 'url' => ['/user/registration/register'], 'visible' => Yii::$app->user->isGuest],
  50.         ],
  51.     ]);
  52.     NavBar::end();
  53.     ?>
  54.  
  55.     <div class="container">
  56.         <?= Breadcrumbs::widget([
  57.             'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
  58.         ]) ?>
  59.         <?= Alert::widget() ?>
  60.         <?= $content ?>
  61.     </div>
  62. </div>
  63.  
  64. <footer class="footer">
  65.     <div class="container">
  66.         <p class="pull-left">&copy; My Company <?= date('Y') ?></p>
  67.  
  68.         <p class="pull-right"><?= Yii::powered() ?></p>
  69.     </div>
  70. </footer>
  71.  
  72. <?php $this->endBody() ?>
  73. </body>
  74. </html>
  75. <?php $this->endPage() ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement