[moka同学笔记]yii2.0的下拉菜单与bootstrap下拉菜单

1.yii2下拉菜单

             <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">管理<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><?= Html::a('新建文章', ['article/create']) ?></li>
<li><a href="<?=Url::toRoute(['article/list']);?>">管理文章</a></li>
<li><a href="#">添加栏目</a></li>
<li><a href="<?=Url::toRoute(['article-category/index']);?>">管理栏目</a></li>
</ul>
</li>

2.bootrap下拉菜单

                 <?php
use yii\bootstrap\ButtonDropdown;
echo ButtonDropdown::widget([
'label' => '操作',
'dropdown' => [
'items' => [
['label' => '文章列表', 'url' => Url::toRoute(['article/list'])],
['label' => '栏目列表', 'url' => Url::toRoute(['article-category/index'])],
],
],
]);?>

[moka同学笔记]yii2.0的下拉菜单与bootstrap下拉菜单

上一篇:Windows下Node.js的安装与配置


下一篇:Python爬虫--- 1.1请求库的安装与使用