main.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. use yii\helpers\Html;
  3. use yii\widgets\Menu;
  4. use yii\widgets\Breadcrumbs;
  5. /**
  6. * @var $this \yii\base\View
  7. * @var $content string
  8. */
  9. app\config\AppAsset::register($this);
  10. ?>
  11. <?php $this->beginPage(); ?>
  12. <!DOCTYPE html>
  13. <html lang="en">
  14. <head>
  15. <meta charset="utf-8"/>
  16. <title><?php echo Html::encode($this->title); ?></title>
  17. <?php $this->head(); ?>
  18. </head>
  19. <body>
  20. <?php $this->beginBody(); ?>
  21. <div class="container">
  22. <div class="masthead">
  23. <h3 class="text-muted">My Company</h3>
  24. <?php echo Menu::widget(array(
  25. 'options' => array('class' => 'nav navbar-nav nav-justified'),
  26. 'items' => array(
  27. array('label' => 'Home', 'url' => array('/site/index')),
  28. array('label' => 'About', 'url' => array('/site/about')),
  29. array('label' => 'Contact', 'url' => array('/site/contact')),
  30. Yii::$app->user->isGuest ?
  31. array('label' => 'Login', 'url' => array('/site/login')) :
  32. array('label' => 'Logout (' . Yii::$app->user->identity->username .')' , 'url' => array('/site/logout')),
  33. ),
  34. )); ?>
  35. </div>
  36. <?php echo Breadcrumbs::widget(array(
  37. 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : array(),
  38. )); ?>
  39. <?php echo $content; ?>
  40. <div class="footer">
  41. <p>&copy; My Company <?php echo date('Y'); ?></p>
  42. <p>
  43. <?php echo Yii::powered(); ?>
  44. Template by <a href="http://twitter.github.io/bootstrap/">Twitter Bootstrap</a>
  45. </p>
  46. </div>
  47. </div>
  48. <?php $this->endBody(); ?>
  49. </body>
  50. </html>
  51. <?php $this->endPage(); ?>