diff --git a/frontend/views/layouts/_services.php b/frontend/views/layouts/_services.php new file mode 100644 index 0000000..905bef5 --- /dev/null +++ b/frontend/views/layouts/_services.php @@ -0,0 +1,33 @@ + + + function (ActiveQuery $query) { $query->with('lang.alias') - ->where([ 'in_menu' => true ]) ->orderBy([ 'sort' => SORT_ASC ]); }, ] @@ -275,30 +274,17 @@ _________________________________________________________ --> \Yii::t('app', 'Главная'), - 'url' => [ 'site/index' ], + 'label' => \Yii::t('app', 'Услуги'), + 'items' => $this->render( + '_services', + [ + 'pageCategories' => $pageCategories, + ] + ), + 'options' => [ + 'class' => '_dropdown-wr', + ], ]; - foreach ($pageCategories as $category) { - if (empty($category->pages)) { - continue; - } - $pages = []; - foreach ($category->pages as $page) { - $pages[] = [ - 'label' => $page->lang->title, - 'url' => Url::to( - [ - 'page/view', - 'alias' => $page->lang->alias, - ] - ), - ]; - } - $items[] = [ - 'label' => $category->lang->title, - 'items' => $pages, - ]; - } $items[] = [ 'label' => \Yii::t('app', 'О клинике'), 'url' => [ 'site/about' ], -- libgit2 0.21.4