filipac/menu-active-check
Composer 安装命令:
composer require filipac/menu-active-check
包简介
关键字:
README 文档
README
I had the following scenario: In a bootstrap admin theme I wanted the items in the Menu to pe marked as ACTIVE if I was on a certain controller. I had to write a lot of code everytime so i made a blade tag for quick access to the rule. Example how to use:
<li class="{@checkActive Dashboard|active}">
<a href="{{URL::to('/admin')}}" >
<i class="fa fa-dashboard icon">
<b class="bg-danger"></b>
</i>
<span>@lang('admin.menu.dashboard')
</span>
</a>
</li>
Explanation: if the current controller is DashboardController the script will echo "active" so that the menu highlights. You can replace active with any class you want to add to the active menu items. This is a quick and rough package so if you want to make impovements, fork commit & merge request.
I wanted to have this for further Laravel projects.
Installation:
Add "filipac/menu-active-check": "~1.0" to the require section of composer.json
Run composer update
In /app/config/app.php add the following to the end of providers array
'Filipac\MenuActiveCheck\MenuActiveCheckServiceProvider',
You are done, now you can use {@checkActive ControllerName|css-active-class} in your blade files!
统计信息
- 总下载量: 30
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2014-08-30