跳到内容

面包屑构建器

编辑此页

sonata.admin.breadcrumbs_builder 服务用于每个页面的布局中,以计算两个面包屑的底层数据

  • 一个作为文本,出现在文档 <head> 标签的 <title> 标签中;
  • 另一个作为 html,在页面顶部以水平条可见。

获取给定管理员的给定操作的面包屑是这样完成的

1
$this->get('sonata.admin.breadcrumbs_builder')->getBreadcrumbs($admin, $action);

配置

1
2
3
4
5
6
7
# config/packages/sonata_admin.yaml

sonata_admin:
    breadcrumbs:
        # use this to change the default route used to generate the link
        # to the parent object inside a breadcrumb, when in a child admin
        child_admin_route: show
这项工作,包括代码示例,根据 Creative Commons BY-SA 3.0 许可协议获得许可。
目录
    版本