I just want to display menus from database in yii2 advanced template frontend. Also i have static menus. I am using menu widget
Here is my code
<?php
echo Menu::widget([
'options' => ['class' => 'about_content'],
'items' => CMS::getCMSPages(),
]);
?>
Here CMS::getCMSPages() will get the menus from database. And also i have static menu. So i added into the menu widget like this
<?php
echo Menu::widget([
'options' => ['class' => 'about_content'],
'items' => [[CMS::getCMSPages()],
['label' => 'contact', 'url' => ['site/index']]
]
]);
?>
But this is not working. Someone help me guys
CMS::getCMSPages()
method should return properly prepared array of items. Something like this:Also you should merge items array: