twokings/hierarchy

Bolt 5 的简单层次内容

安装: 773

依赖: 0

建议者: 0

安全: 0

星级: 4

关注者: 2

分支: 1

开放问题: 0

类型:bolt-extension

v0.4.0 2023-05-23 12:59 UTC

This package is auto-updated.

Last update: 2024-09-23 15:51:18 UTC


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