monsieurbiz/mbiz_menu
Composer 安装命令:
composer require monsieurbiz/mbiz_menu
包简介
Magento module which gives a better menu block.
README 文档
README
Mbiz_Menu is a Magento 1 module which provides an optimized menu as a simple block.
Usage
The block mbiz_menu/page_html_topmenu gives 2 methods:
getCategoriesTree()which returns main categories with children. Children are available using the method$cat->get_children().getCategorieswhich returns all the categories available in the menu.
Each category has 2 new data available:
contains_current_categoryis set totrueif the category has the current category in its children.is_current_categoryis set totrueif the category is the actual current one.
Example
No template is provided. But here is an really simple example:
<?php /* @var $this Mbiz_Menu_Block_Page_Html_Topmenu */ $_tree = $this->getCategoriesTree(); $_output = $this->helper('catalog/output'); ?> <ul> <?php foreach ($_tree as $_mainCategory): ?> <li class="<?php if ($_mainCategory->getIsCurrentCategory() || $_mainCategory->getContainsCurrentCategory()): ?>active<?php endif; ?>"> <a href="<?php echo $_mainCategory->getUrl(); ?>"> <?php echo $_output->categoryAttribute($_mainCategory, $_mainCategory->getName(), 'name'); ?> </a> <?php if ($_children = $_mainCategory->get_children()): ?> <ul> <?php foreach ($_children as $_child): ?> <li class="<?php if ($_child->getIsCurrentCategory()): ?>current<?php endif; ?>"> <a href="<?php echo $_child->getUrl(); ?>"> <?php echo $_output->categoryAttribute($_child, $_child->getName(), 'name'); ?> </a> </li> <?php endforeach; ?> </ul> <?php endif; ?> </li> <?php endforeach; ?> </ul>
By default the block uses a 72 hours cache lifetime. Of course the default value can be overrided.
monsieurbiz/mbiz_menu 适用场景与选型建议
monsieurbiz/mbiz_menu 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 400 次下载、GitHub Stars 达 3, 最近一次更新时间为 2016 年 08 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 monsieurbiz/mbiz_menu 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 monsieurbiz/mbiz_menu 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 400
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 5
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2016-08-21