Commit c7048abcf2304b3561325dbc164ef48f13ac8c43

Authored by Anastasia
1 parent ed4cbcdd

- nav widget without class nav

Showing 2 changed files with 29 additions and 5 deletions   Show diff stats
frontend/views/layouts/main.php
... ... @@ -15,7 +15,6 @@
15 15 use artbox\core\models\Feedback;
16 16 use artbox\core\models\PageCategory;
17 17 use artbox\core\models\User;
18   - use common\models\page\Category;
19 18 use common\models\Service;
20 19 use common\models\Settings;
21 20 use frontend\assets\AppAsset;
... ... @@ -23,7 +22,7 @@
23 22 use frontend\assets\SliderAsset;
24 23 use frontend\widgets\ArtboxModalWidget;
25 24 use frontend\widgets\LanguageWidget;
26   - use yii\bootstrap\Nav;
  25 + use frontend\widgets\Nav;
27 26 use yii\db\ActiveQuery;
28 27 use yii\web\View;
29 28  
... ... @@ -177,9 +176,6 @@
177 176 <?php echo Nav::widget(
178 177 [
179 178 'items' => $items,
180   - 'options' => [
181   - 'class' => '',
182   - ],
183 179 'activateItems' => false,
184 180 ]
185 181 ); ?>
... ...
frontend/widgets/Nav.php 0 → 100644
  1 +<?php
  2 + /**
  3 + * Created by PhpStorm.
  4 + * User: stes
  5 + * Date: 25.05.18
  6 + * Time: 17:55
  7 + */
  8 +
  9 + namespace frontend\widgets;
  10 +
  11 + use yii\helpers\Html;
  12 +
  13 + class Nav extends \yii\bootstrap\Nav
  14 + {
  15 + public function init()
  16 + {
  17 + if ($this->route === null && \Yii::$app->controller !== null) {
  18 + $this->route = \Yii::$app->controller->getRoute();
  19 + }
  20 + if ($this->params === null) {
  21 + $this->params = \Yii::$app->request->getQueryParams();
  22 + }
  23 + if ($this->dropDownCaret === null) {
  24 + $this->dropDownCaret = '<span class="caret"></span>';
  25 + }
  26 + Html::addCssClass($this->options, []);
  27 + }
  28 + }
0 29 \ No newline at end of file
... ...