main.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. use yii\bootstrap\NavBar;
  3. use yii\bootstrap\Nav;
  4. use yii\helpers\Html;
  5. /**
  6. * @var \yii\web\View $this
  7. * @var string $content
  8. */
  9. $asset = yii\gii\GiiAsset::register($this);
  10. ?>
  11. <?php $this->beginPage() ?>
  12. <!DOCTYPE html>
  13. <html lang="en">
  14. <head>
  15. <meta charset="utf-8"/>
  16. <meta name="viewport" content="width=device-width, initial-scale=1">
  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' => Html::img($asset->baseUrl . '/logo.png'),
  25. 'brandUrl' => ['default/index'],
  26. 'options' => ['class' => 'navbar-inverse navbar-fixed-top'],
  27. ]);
  28. echo Nav::widget([
  29. 'options' => ['class' => 'nav navbar-nav navbar-right'],
  30. 'items' => [
  31. ['label' => 'Home', 'url' => ['default/index']],
  32. ['label' => 'Help', 'url' => 'https://github.com/yiisoft/yii2/blob/master/docs/guide/gii.md'],
  33. ['label' => 'Application', 'url' => Yii::$app->homeUrl],
  34. ],
  35. ]);
  36. NavBar::end();
  37. ?>
  38. <div class="container">
  39. <?= $content ?>
  40. </div>
  41. <footer class="footer">
  42. <div class="container">
  43. <p class="pull-left">A Product of <a href="http://www.yiisoft.com/">Yii Software LLC</a></p>
  44. <p class="pull-right"><?= Yii::powered() ?></p>
  45. </div>
  46. </footer>
  47. <?php $this->endBody() ?>
  48. </body>
  49. </html>
  50. <?php $this->endPage() ?>