public function run() { $alias = \Yii::$app->request->get('alias'); if (\Yii::$app->controller->route != 'store/category/brand') { $type = 'category'; $items = \app\modules\store\models\Category::getNavigationData(); } else { $type = 'brand'; $items = \app\modules\store\models\Manufacturer::getNavigationData(); } return $this->render('categoryNavView', ['items' => $items, 'type' => $type, 'alias' => $alias]); }
?> <?php NavBar::begin(['brandLabel' => Yii::$app->name, 'brandUrl' => Yii::$app->homeUrl, 'options' => ['class' => 'navbar-inverse navbar-fixed-top']]); echo Nav::widget(['options' => ['class' => 'navbar-nav navbar-right'], 'items' => [['label' => 'Отзывы', 'url' => ['/cms/reviews/index']], ['label' => 'Статьи', 'url' => ['/cms/article/list', 'type' => 'article']], ['label' => 'Новости', 'url' => ['/cms/article/list', 'type' => 'news']], ['label' => 'Акции', 'url' => ['/cms/article/list', 'type' => 'stock']]]]); NavBar::end(); ?> <br/><br/><br/> <div class="container"> <div class="row"> <div class="col-md-4"> <div class="panel panel-success"> <div class="panel-heading">Каталог</div> <div class="panel-body"> <ul class="nav nav-pills nav-stacked"> <?php foreach (\app\modules\store\models\Category::getNavigationData() as $item) { ?> <li> <?php echo Html::a(Html::img($item->image->resize('33x30')) . ' ' . $item->title, $item->path); ?> </li> <?php } ?> </ul> </div> </div> </div> <div class="col-md-8"> <?php