main.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /* @var $this \yii\web\View */
  3. /* @var $content string */
  4. use yii\helpers\Html;
  5. use yii\bootstrap\Nav;
  6. use yii\bootstrap\NavBar;
  7. use yii\widgets\Breadcrumbs;
  8. use app\assets\AppAsset;
  9. AppAsset::register($this);
  10. ?>
  11. <?php $this->beginPage() ?>
  12. <!DOCTYPE html>
  13. <html lang="<?= Yii::$app->language ?>">
  14. <head>
  15. <meta charset="<?= Yii::$app->charset ?>">
  16. <meta name="viewport" content="width=device-width, initial-scale=1">
  17. <?= Html::csrfMetaTags() ?>
  18. <title><?= Html::encode($this->title) ?></title>
  19. <?php $this->head() ?>
  20. </head>
  21. <body>
  22. <?php $this->beginBody() ?>
  23. <div class="wrap">
  24. <?php
  25. NavBar::begin([
  26. 'brandLabel' => 'My Company',
  27. 'brandUrl' => Yii::$app->homeUrl,
  28. 'options' => [
  29. 'class' => 'navbar-inverse navbar-fixed-top',
  30. ],
  31. ]);
  32. echo Nav::widget([
  33. 'options' => ['class' => 'navbar-nav navbar-right'],
  34. 'items' => [
  35. ],
  36. ]);
  37. NavBar::end();
  38. ?>
  39. <div class="container">
  40. <?= Breadcrumbs::widget([
  41. 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
  42. ]) ?>
  43. <?= $content ?>
  44. </div>
  45. </div>
  46. <footer class="footer">
  47. <div class="container">
  48. <p class="pull-left">&copy; My Company <?= date('Y') ?></p>
  49. <p class="pull-right"><?= Yii::powered() ?></p>
  50. </div>
  51. </footer>
  52. <?php $this->endBody() ?>
  53. </body>
  54. </html>
  55. <?php $this->endPage() ?>