From 41fb7b5b12134869716377ced16247481be48a1a Mon Sep 17 00:00:00 2001 From: Anastasia Date: Thu, 21 Jun 2018 14:43:08 +0300 Subject: [PATCH] - menu --- frontend/views/layouts/main.php | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/frontend/views/layouts/main.php b/frontend/views/layouts/main.php index 84dfa88..4838ec3 100755 --- a/frontend/views/layouts/main.php +++ b/frontend/views/layouts/main.php @@ -307,41 +307,14 @@ $this->registerMetaTag( 'url' => Url::to(['package/index']), ]; - # определяю, кому из итемов присвоить class="active' - $itemKey=0; - $test=[]; - foreach ($items as $key => $item) - { - - if(strpos(\Yii::$app->request->url,$item['url'])!==false ) - { - $test[$key]['label']=$item['label']; - $test[$key]['options'] = [ 'class' => 'active' ]; - $test[$key]['url']= false; - - - } - elseif( \Yii::$app->request->url=='/' && $item['label']==\Yii::t('app', 'Prices')) - { - $test[$key]['label']=$item['label']; - $test[$key]['options'] = [ 'class' => 'active' ]; - $test[$key]['url']= Url::to(['site/prices']); - - } - else - { - $test[$key]['label']=$item['label']; - $test[$key]['url']=$item['url']; - } - - } + ?> $test, + 'items' => $items, 'activateItems' => false, ] ); ?> -- libgit2 0.21.4