djgadd / themosis-menu
该软件包已被废弃且不再维护。未建议替代软件包。
一个简化菜单操作的软件包。
1.1.3
2018-02-01 15:43 UTC
Requires
- php: >=7.0
- composer/installers: ~1.2
- djgadd/themosis-cache: ^1.0
- djgadd/themosis-illuminate: ^1.0
- themosis/framework: ^1.3
This package is auto-updated.
Last update: 2021-10-15 21:19:18 UTC
README
一个简化菜单操作的软件包。需要设置 keltiecochrane/themosis-illuminate
和 keltiecochrane/themosis-cache
以支持集合和缓存。将从源构建菜单并永久缓存,如果更新或删除,则将从缓存中清除菜单。
安装
通过 composer 安装:- composer require keltiecochrane/themosis-menu
在您的 theme/resources/config/providers.php
文件中注册服务提供者:- KeltieCochrane\Menu\MenuServiceProvider::class,
可选地,在您的 theme/resources/config/theme.php
文件中注册别名:- 'Menu' => KeltieCochrane\Menu\MenuFacade::class,
示例
$menu = Menu::getByLocation('header-nav');
$menu->name; // The menu's name
$menu->each(function ($item) {
$item->children; // The menu items children
$item->descendants; // A collection of IDs for all this items descendants
$item->active; // Boolean indicating whether this item is the current page/post/etc.
$item->active_descendant // Boolean indicating whether a descendant is active
// Plus all the usual WP_Post fields
});
有关更多信息,请参阅 Laravel 文档。
助手函数
以下(附加)助手函数可用:-
- getMenuById(int $menuId, int $activePostId = null)
- getMenuByLocation(string $location, int $activePostId = null)
待办事项
- 测试
支持
此插件按原样提供,尽管我们会尽力提供帮助。
贡献
我们鼓励并非常感谢任何贡献,您可以通过以下方式做出贡献:-
- 报告错误
- 建议功能
- 发送拉取请求