where([ 'in_menu' => true ]) ->orderBy([ 'id' => SORT_DESC ]) ->all(); $pages_items = []; foreach($pages as $page) { $pages_items[] = [ 'label' => $page->title, 'url' => [ 'site/page', 'id' => $page->id, ], ]; } $categories = Category::find() ->where([ 'depth' => 0 ]) ->all(); $submenu_items = []; foreach($categories as $category) { $submenu_items[] = [ 'label' => $category->name, 'url' => [ 'filter/category', 'id' => $category->category_id, ], ]; } $menu_items = [ [ 'label' => 'Контрактные продукты', 'url' => '#', 'items' => $submenu_items, ], [ 'label' => 'Галерея объектов', 'url' => [ '/project' ], ], [ 'label' => 'Статьи', 'url' => [ '/article' ], ], [ 'label' => 'Контакты', 'url' => [ 'site/contact' ], ], ]; array_splice($menu_items, 1, 0, $pages_items); ?> beginPage() ?> <?= Html::encode($this->title) ?> head() ?> beginBody() ?>
меню
[ 'class' => 'main-menu', ], 'items' => $menu_items, ]); ?>
'question-form visible-md visible-lg hidden', ]); ?>
'logo_', ]) ?>
endBody() ?> endPage() ?>