Commit 78a56c446f0aa9c9b53031a8f508761a8f8f5e17

Authored by Administrator
1 parent 860087b0

add active menu

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
frontend/views/layouts/main-menu.php
... ... @@ -8,7 +8,7 @@ foreach (Category::find ()->all () as $category){
8 8 $categoryObject = Yii::$app->request->get('category');
9 9 $menu[] = ['label' => $category->name ,
10 10 'url' => Url::to(['catalog/category', 'category' => $category]),
11   - 'active' => isset($categoryObject) && Yii::$app->request->get('category')->alias == $category->alias ? true : false ];
  11 + 'active' => isset($categoryObject) && $categoryObject->alias == $category->alias ? true : false ];
12 12 }
13 13  
14 14 $main_menu = Menu::widget([
... ...