fabz29/breadcrumb-bundle
Composer 安装命令:
composer require fabz29/breadcrumb-bundle
包简介
Fabz29BreadcrumbBundle is a Symfony Bundle created to facilitate the management of breadcrumbs in your project.
关键字:
README 文档
README
Fabz 29 Breadcrumb Bundle is a Symfony Bundle created to be the most simple unique way to manage breadcrumb. You don't have several option just one and just one way to do ! That's simple isn't ?
Installation
####Step 1 :
- require fabz29/breadcrumb-bundle
Step 2 : Add the bundle to your AppKernel.php
// config/bundles.php ... Fabz29\BreadcrumbBundle\Fabz29BreadcrumbBundle::class => ['all' => true],
Step 3 : Configure the bundle
// config/packages/fabz29_breadcrumb.yaml fabz29_breadcrumb: template: 'default/_breadcrumb.html.twig' home_route_name: 'Home' home_route: 'homepage' home_route_params: []
Step 4 [RECOMMENDED|OPTIONAL] : Overide the template
<ol class="breadcrumb hide-phone p-0 m-0"> {% for link in breadcrumb.links %} <li class="breadcrumb-item"> <a href="{{ path(link.route, link.routeParams ) }}">{{ link.name|trans({}, 'messages' }}</a> </li> {% endfor %} </ol>
How to use it
-
in your controller :
$breadcrumb = $this->get("fabz29_breadcrumb.breadcrumb.manager"); $breadcrumb->addItem('Settings', 'user_settings');
-
in your twig template where the fuc* you want :
{{ fabz29_render_breadcrumb() }}
TODO
- Allow GET parameters not handle by routing component
License
The bundle is developped by Fabien ZANETTI. Licence MIT
统计信息
- 总下载量: 433
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-05-14