wartron/yii2-widgets-urlactive
Composer 安装命令:
composer require wartron/yii2-widgets-urlactive
包简介
Yii2 Widgets to override Nav and Menu isItemActive
README 文档
README
These two simple widgets provide an easy way to have both \yii\widgets\Menu and \yii\bootstrap\Nav items active state depend on more than the url it is set to. We accomplish this by adding an Array of other possible url patterns that it should check against. If you look at either Menu.php or Nav.php the code is pretty simple.
An Example of using this wartron\yii2widgets\urlactive\Nav widget instead of the stock for basic crud is that all the crud urls will keep the menu items state to active.
use wartron\yii2widgets\urlactive\Nav;
echo Nav::widget([
'items' => [
[
'label' => 'Gizmos',
'url' => ['/crud/gizmo/index'],
'urlActive' => [
['/crud/gizmo/view'],
['/crud/gizmo/update'],
['/crud/gizmo/create'],
]
],
]
]);
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-08-23