From 9fbe1412e956766b56e811c0071c54179d0924d5 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 4 Oct 2017 10:55:14 +0300 Subject: [PATCH] -Services in menu ready --- frontend/views/layouts/_services.php | 33 +++++++++++++++++++++++++++++++++ frontend/views/layouts/main.php | 34 ++++++++++------------------------ 2 files changed, 43 insertions(+), 24 deletions(-) create mode 100644 frontend/views/layouts/_services.php 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