eseperio/yii2-bigmenu-widget 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

eseperio/yii2-bigmenu-widget

Composer 安装命令:

composer require eseperio/yii2-bigmenu-widget

包简介

A yii2 pure CSS multilevel menu. With option to load views inside menu via ajax.

README 文档

README

Any code contribution is welcome

Bigmenu renders a PURE CSS multilevel menu with advanced functions. It works like default nav widget, but dropdowns are pure css. It also allows large menu items loaded vía ajax using page parameter. It has no limit on levels, but be careful. A lot of levels are uncomfortable for users.

Installation

composer require eseperio/yii2-bigmenu-widget

When an item have page property and items, the first one will be available on medium-large devices meanwhile on second will be available on mobile devices.

Screenshots

  echo Bigmenu::widget([
      'items' => [
          [
              'label' => 'Home',
              'url' => ['site/index'],
              'linkOptions' => [...],
          ],
          [
              'label' => 'Multilevel',
              'items' => [
                   ['label' => 'Level 1 - Dropdown A', 'url' => '#'],
                   '<li class="divider"></li>',
                   '<li class="dropdown-header">Dropdown Header</li>',
                   ['label' => 'Level 1 - Dropdown B', 'url' => '#'],
              ],
          ],
          [
              'label' => 'Login',
              'url' => ['site/login'],
              'visible' => Yii::$app->user->isGuest
          ],
          [
              'label' => 'Login',
              'url' => ['site/login'],
              'visible' => Yii::$app->user->isGuest,
              'page' => ['site/menu']
          ],
      ],
      'options' => ['class' =>'nav-pills'], // set this to nav-tab to get tab-styled navigation
      'jsOptions' => ['widthToEnableResponsive'=> 768], // set this to override the options used in js
  ]);

How to use

This widget is based on yii/bootstrap/nav widget yii\bootstrap\nav. The main differences are:

  1. Allows infinite multilevel. For a better usability don´t use more than 3 levels.
  2. Allow render a page as a menu panel. With this you are free to make complex and advanced dropdowns menus.
  3. Render of pages in menu is made with ajax, and only one request is made per panel.

To use as simple multilevel pass an array to items property. See yii\bootstrap\nav documentation.

Dynamic panels

To use dynamic panels add to the menu item the property "page". This must be a link to the action that renders the page.

Bigmenu::widget([
   'hamburger' => "slide",
   'items' => [
      ['label'=>"Dynamic content", "url"=>["site/index"], "page"=>["site/samplemenupage"] ],
      ...
   ]
])

In your controller use eseperio\yii2-bigmenu\widget\BigmenuTrait. Then in your action, to render content call $this->renderBigmenu($view,$options).

Note: The trait only simplifies the task of differenciating render method, between render and renderAjax. So you can do this in your own controller if you don´t want to use traits.

Change hamburger

This widget implements Hamburgers by jonsuh. You can change the hamburger like this

Bigmenu::widget([
   'hamburger' => "slide",
   'items' => [...]
])

Change width to enable responsive

If you want custom the with of the responsive devise, you must set the property jsOptions

Bigmenu::widget([
  'jsOptions' => ['widthToEnableResponsive'=> 992],
   'items' => [...]
])

Screenshots

This first screenshot shows a view rendered and loaded vía ajax automatically with this widget. Bigmenu screenshot Bigmenu screenshot Mobile friendly Bigmenu screenshot

eseperio/yii2-bigmenu-widget 适用场景与选型建议

eseperio/yii2-bigmenu-widget 是一款 基于 SCSS 开发的 Composer 扩展包,目前已累计 915 次下载、GitHub Stars 达 5, 最近一次更新时间为 2017 年 09 月 04 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「menu」 「css」 「html」 「ajax」 「widget」 「big」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 eseperio/yii2-bigmenu-widget 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 eseperio/yii2-bigmenu-widget 我们能提供哪些服务?
定制开发 / 二次开发

基于 eseperio/yii2-bigmenu-widget 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 915
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 14
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 1
  • 开发语言: SCSS

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-09-04