twokings / hierarchy
Bolt 5 的简单层次内容
v0.4.0
2023-05-23 12:59 UTC
Requires
- php: >=7.1.3
Requires (Dev)
- bolt/core: ^5.0.0
- symplify/easy-coding-standard: ^10.2
README
使用 menu.yml
为 Bolt 5 创建层次内容。
配置
menu
: 需要检查的菜单列表。
Twig 函数和过滤器
生成如 /foo/bar
这样的优美 URL 需要使用 hMenu
函数和 hLink
过滤器。
hMenu('main')
: 使用此函数获取菜单中的优美 URL。getParent(record)
getParents(record)
getSiblings(record)
getChildren(record)
record|hLink
: 在记录上使用此过滤器以获取优美 URL。
路由
将以下内容添加到您的 routes.yaml
中以允许使用优美 URL。
hierarchicalRoute:
resource: 'TwoKings\Hierarchy\Controller\Controller'
type: annotation