top-menu.php 528 B

1234567891011121314151617181920
  1. <?php
  2. /* @var $this \yii\web\View */
  3. /* @var $content string */
  4. $controller = $this->context;
  5. $menus = $controller->module->menus;
  6. $route = $controller->route;
  7. foreach ($menus as $i => $menu) {
  8. $menus[$i]['active'] = strpos($route, trim($menu['url'][0], '/')) === 0;
  9. }
  10. $this->params['nav-items'] = $menus;
  11. $this->params['top-menu'] = true;
  12. ?>
  13. <?php $this->beginContent($controller->module->mainLayout) ?>
  14. <div class="row">
  15. <div class="col-lg-12">
  16. <?= $content ?>
  17. </div>
  18. </div>
  19. <?php $this->endContent(); ?>