How to fetch data from database and set as submenus in yii2?
问题 I have a widget menu in yii2: <?= \yii\widgets\Menu::widget([ 'encodeLabels' => false, 'options' => ['id' => 'dock'], 'items' => [ ['label' => 'ab...', 'template' => '<i class="fa fa-dashboard"></i><a href="{url}">{label}</a>', 'options' => ['class' => 'launcher dropdown hover'], 'submenuTemplate' => "\n<ul class='dropdown-menu'>\n{items}\n</ul>\n", 'items' => [ ['label' => 'a', 'url' => ['users/..'], 'visible' => Yii::$app->user->isGuest ], ['label' => 'b', 'url' => ['users/..'], 'visible' =