main.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. use yii\bootstrap\Nav;
  3. use yii\bootstrap\NavBar;
  4. use yii\helpers\Html;
  5. /* @var $this \yii\web\View */
  6. /* @var $content string */
  7. list(, $url) = Yii::$app->assetManager->publish('@mdm/admin/assets');
  8. $this->registerCssFile($url.'/main.css');
  9. ?>
  10. <?php $this->beginPage() ?>
  11. <!DOCTYPE html>
  12. <html lang="en">
  13. <head>
  14. <meta charset="utf-8"/>
  15. <meta name="viewport" content="width=device-width, initial-scale=1">
  16. <?= Html::csrfMetaTags() ?>
  17. <title><?= Html::encode($this->title) ?></title>
  18. <?php $this->head() ?>
  19. </head>
  20. <body>
  21. <?php $this->beginBody() ?>
  22. <?php
  23. NavBar::begin([
  24. 'brandLabel' => false,
  25. 'options' => ['class' => 'navbar-inverse navbar-fixed-top'],
  26. ]);
  27. if (!empty($this->params['top-menu']) && isset($this->params['nav-items'])) {
  28. echo Nav::widget([
  29. 'options' => ['class' => 'nav navbar-nav'],
  30. 'items' => $this->params['nav-items'],
  31. ]);
  32. }
  33. echo Nav::widget([
  34. 'options' => ['class' => 'nav navbar-nav navbar-right'],
  35. 'items' => $this->context->module->navbar,
  36. ]);
  37. NavBar::end();
  38. ?>
  39. <div class="container">
  40. <?= $content ?>
  41. </div>
  42. <footer class="footer">
  43. <div class="container">
  44. <p class="pull-right"><?= Yii::powered() ?></p>
  45. </div>
  46. </footer>
  47. <?php $this->endBody() ?>
  48. </body>
  49. </html>
  50. <?php $this->endPage() ?>