cyneek/yii2-menu
Composer 安装命令:
composer require cyneek/yii2-menu
包简介
DataBase loader with menu items for Kartik Menu Widget.
README 文档
README
Menu widget that loads Kartik sidenav widget with database items.
What's Menu Widget?
This widget gets from database a group of ordered and hierarchical items and loads them into the Kartik sidevan widget.
Developed by Joseba Juániz (@Patroklo)
Minimum requirements
- Yii2
- Php 5.4 or above
Future plans
- None right now.
License
This is free software. It is released under the terms of the following BSD License.
Copyright (c) 2014, by Cyneek All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of Cyneek nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Instalation
-
Install Yii 2
-
Install package via composer
"cyneek/yii2-menu": "dev-master" -
Launch the migration
php yii migrate --migrationPath=@vendor/cyneek/yii2-menu/migrations -
Profit!
Widget definition
The first step is to fill the menu table with a menu structure. This can be achieved with the built-in methods of the MenuItems ActiveRecord:
add_menu_item
- label (String) (obligatory)
Defines the text that will be shown for this menu item in the SideNav Widget.
- url (String) (optional)
The url where the menu item will link in the sidenav.
- parent (String) (optional)
Name of the parent menu item. This will create a hierarchical menu.
- name (String) (optional)
Name of the menu item, if not defined, will use the label text.
- icon (String) (optional)
CSS Bootstrap icon name that will be shown next to the menu item text.
- options (String) (optional)
HTML Options that will be added into the menu item.
- visible (String) (optional)
If 0, the menu item and all its children won't be shown at the sidenav.
delete_menu_item
Warning: It deletes the menu item and all its children.
- name (String) (obligatory)
Name of the menu item, that will be deleted.
hide_menu_item
Warning: This will hide the menu item and all its children.
- name (String) (obligatory)
show_menu_item
- name (String) (obligatory)
Widget use
echo \cyneek\yii2\menu\Menu::widget($options);
Options is an array as defined in the Kartik Sidenav Widget Options.
cyneek/yii2-menu 适用场景与选型建议
cyneek/yii2-menu 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 196 次下载、GitHub Stars 达 2, 最近一次更新时间为 2015 年 03 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「menu」 「widget」 「yii2」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 cyneek/yii2-menu 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 cyneek/yii2-menu 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 cyneek/yii2-menu 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A custom URL rule class for Yii 2 which allows to create translated URL rules
A Symfony extension to get active class base on current bundle/controller/action
Yii2 LightBox image galary widget uses Lightbox v2.10.0 by Lokesh Dhakar
Add a weather widget to Flarum
SCEditor, a lightweight WYSIWYG BBCode & HTML editor extension for Yii 2.0 Framework
Yii2 prettyPhoto image galary widget uses Lightbox view control jquery.prettyphoto.js
统计信息
- 总下载量: 196
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD
- 更新时间: 2015-03-25