Nav - Menu's
<?php
echo Nav::widget([
'encodeLabels' => false,
'items' => [
[ 'label' => 'Menu1',
'visible' => (isset(Yii::$app->user->identity->role) && Yii::$app->user->identity->role == 'admin'),
'items' => [
['label' => 'Item1', 'url' => ['/control/action'] ],
['label' => 'Item2', 'url' => ['/control/action'] ],
['label' => 'Item3', 'url' => ['/control/action'] ],
[ 'label' => 'Item4',
'url' => ['/control/action'],
'linkOptions' => array('onclick'=>'return confirm("Are you sure? ")'),
],
['label' => '-----------------------------------'],
['label' => 'Item1', 'url' => ['/control/action'] ],
],
'options' => ['class' => 'nav-item']
],
[ 'label' => 'Menu2',
'visible' => (isset(Yii::$app->user->identity->role) && Yii::$app->user->identity->role == 'admin'),
'items' => [
['label' => 'Item1', 'url' => ['/control/action'] ],
['label' => 'Item2', 'url' => ['/control/action'] ],
[ 'label' => 'Item3',
'url' => 'https://server.com/page1',
'template'=> '<a href="{url}" target="_blank">{label}</a>',
'linkOptions' => ['target' => '_blank'],
],
],
'options' => ['class' => 'nav-item']
],
],
]);