Commit 41fb7b5b12134869716377ced16247481be48a1a

Authored by Anastasia
1 parent ba7eea0e

- menu

Showing 1 changed file with 2 additions and 29 deletions   Show diff stats
frontend/views/layouts/main.php
@@ -307,41 +307,14 @@ $this->registerMetaTag( @@ -307,41 +307,14 @@ $this->registerMetaTag(
307 'url' => Url::to(['package/index']), 307 'url' => Url::to(['package/index']),
308 ]; 308 ];
309 309
310 - # определяю, кому из итемов присвоить class="active'  
311 - $itemKey=0;  
312 - $test=[];  
313 - foreach ($items as $key => $item)  
314 - {  
315 -  
316 - if(strpos(\Yii::$app->request->url,$item['url'])!==false )  
317 - {  
318 - $test[$key]['label']=$item['label'];  
319 - $test[$key]['options'] = [ 'class' => 'active' ];  
320 - $test[$key]['url']= false;  
321 -  
322 -  
323 - }  
324 - elseif( \Yii::$app->request->url=='/' && $item['label']==\Yii::t('app', 'Prices'))  
325 - {  
326 - $test[$key]['label']=$item['label'];  
327 - $test[$key]['options'] = [ 'class' => 'active' ];  
328 - $test[$key]['url']= Url::to(['site/prices']);  
329 -  
330 - }  
331 - else  
332 - {  
333 - $test[$key]['label']=$item['label'];  
334 - $test[$key]['url']=$item['url'];  
335 - }  
336 -  
337 - } 310 +
338 311
339 312
340 ?> 313 ?>
341 314
342 <?php echo Nav::widget( 315 <?php echo Nav::widget(
343 [ 316 [
344 - 'items' => $test, 317 + 'items' => $items,
345 'activateItems' => false, 318 'activateItems' => false,
346 ] 319 ]
347 ); ?> 320 ); ?>