dnabeast/tabmenu
Composer 安装命令:
composer require dnabeast/tabmenu
包简介
HTML menu creator for Blade
README 文档
README
This allows you to define your HTML menu system using easy to read syntax in a blade file.
It allows the menu urls to change if it's called from an admin directory.
Installing
Add the dependency to your project:
composer require DNABeast/tabmenu
##Publish the config file
php artisan vendor:publish
Laravel 5.5:
The ServiceProvider is automatically discovered.
Laravel 5.2:
Add to your app.php config.
DNABeast\TabMenu\TabMenuServiceProvider::class,
You may need to clear the view cache
php artisan view:clear
Usage
In your blade file enter the custom @menu directive, and the @endmenu directive. Enter your menu as a text list. You can indent if you wish.
@menu
[tab][tab]Menu 1
[tab][tab]Menu 2
[tab][tab]Menu 3
@endmenu
outputs
<ul>
<li><a href="/menu-1">Menu 1</a></li>
<li><a href="/menu-2">Menu 2</a></li>
<li><a href="/menu-3">Menu 3</a></li>
</ul>
Sub-menus
Add a tab and the menu item will become a sub-menu.
@menu
[tab][tab]Menu 1
[tab][tab][tab]Menu 1a
[tab][tab][tab][tab]Menu 1ax
[tab][tab]Menu 2
@endmenu
creates
<ul>
<li><a href="/menu-1">Menu 1</a><ul>
<li><a href="/menu-1a">Menu 1a</a><ul>
<li><a href="/menu-1ax">Menu 1ax</a></li></ul>
</li></ul>
</li>
<li><a href="/menu-2">Menu 2</a></li>
</ul>
Set URLs
Put a comma and set the url when it's different to the menu name
@menu
Menu, /menu-one-location
Menu 2
@endmenu
becomes
<ul>
<li><a href="/menu-one-location">Menu</a></li>
<li><a href="/menu-2">Menu 2</a></li>
</ul>
Set a Class
If your menu item requires a class name just add it after a second comma
@menu
Menu Item, /menu-item, action
@endmenu
becomes
<ul>
<li><a href="/menu-item" class="action">Menu Item</a></li>
</ul>
Unwrap the primary ul tag
If you need to add manual menu items it's useful to be able to remove the wrapping <ul> tag.
Publish the config file
php artisan vendor:publish
and change the nowrap flag to true.
@menu
Menu Item, /menu-item, action
@endmenu
becomes
<li><a href="/menu-item" class="action">Menu Item</a></li>
Change the tabs to spaces
I get it. You prefer pragmatism over semantics. You can change the tab to 2 spaces or 4 spaces if you like.
In the published config file type whatever your preferred indentation is.
'indent' => '----'
Alter the prefix for admin links
In the published config file enter the name of your admin folder.
'prefix' => 'dashboard'
dnabeast/tabmenu 适用场景与选型建议
dnabeast/tabmenu 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 53 次下载、GitHub Stars 达 1, 最近一次更新时间为 2016 年 05 月 31 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「menu」 「laravel」 「blade」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 dnabeast/tabmenu 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dnabeast/tabmenu 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 dnabeast/tabmenu 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Symfony extension to get active class base on current bundle/controller/action
Yii2 DynaTree Menu widget uses Dynamic tree view control jquery.dynatree.js
Alfabank REST API integration
Create simple top navigation for laravel
Simple Object oriented menus for Symfony.
Filter Eloquent
统计信息
- 总下载量: 53
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-05-31