echo Nav::widget([ 'options' => ['class' => 'navbar-nav navbar-right'], 'encodeLabels' => false,//配置项encodeLabels为false 即参数items 不过滤html 'items' => $menuItems,]);