Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

80 lignes
2.0 KiB

  1. <?php
  2. /* @var $this \yii\web\View */
  3. /* @var $content string */
  4. use zzcx\assets\AppAsset;
  5. use yii\helpers\Html;
  6. use yii\bootstrap\Nav;
  7. use yii\bootstrap\NavBar;
  8. use yii\widgets\Breadcrumbs;
  9. use common\widgets\Alert;
  10. AppAsset::register($this);
  11. ?>
  12. <?php $this->beginPage() ?>
  13. <!DOCTYPE html>
  14. <html lang="<?= Yii::$app->language ?>">
  15. <head>
  16. <meta charset="<?= Yii::$app->charset ?>">
  17. <meta name="viewport" content="width=device-width, initial-scale=1">
  18. <?= Html::csrfMetaTags() ?>
  19. <title><?= Html::encode($this->title) ?></title>
  20. <?php $this->head() ?>
  21. </head>
  22. <body>
  23. <?php $this->beginBody() ?>
  24. <div class="wrap">
  25. <?php
  26. NavBar::begin([
  27. 'brandLabel' => 'My Company',
  28. 'brandUrl' => Yii::$app->homeUrl,
  29. 'options' => [
  30. 'class' => 'navbar-inverse navbar-fixed-top',
  31. ],
  32. ]);
  33. $menuItems = [
  34. ['label' => 'Home', 'url' => ['/site/index']],
  35. ];
  36. if (Yii::$app->user->isGuest) {
  37. $menuItems[] = ['label' => 'Login', 'url' => ['/site/login']];
  38. } else {
  39. $menuItems[] = '<li>'
  40. . Html::beginForm(['/site/logout'], 'post')
  41. . Html::submitButton(
  42. 'Logout (' . Yii::$app->user->identity->username . ')',
  43. ['class' => 'btn btn-link logout']
  44. )
  45. . Html::endForm()
  46. . '</li>';
  47. }
  48. echo Nav::widget([
  49. 'options' => ['class' => 'navbar-nav navbar-right'],
  50. 'items' => $menuItems,
  51. ]);
  52. NavBar::end();
  53. ?>
  54. <div class="container">
  55. <?= Breadcrumbs::widget([
  56. 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
  57. ]) ?>
  58. <?= Alert::widget() ?>
  59. <?= $content ?>
  60. </div>
  61. </div>
  62. <footer class="footer">
  63. <div class="container">
  64. <p class="pull-left">&copy; My Company <?= date('Y') ?></p>
  65. <p class="pull-right"><?= Yii::powered() ?></p>
  66. </div>
  67. </footer>
  68. <?php $this->endBody() ?>
  69. </body>
  70. </html>
  71. <?php $this->endPage() ?>