If you are using KnpMenu
> 2.1, you can directly use this feature:
- PR: KnpLabs/KnpMenu#228
- Doc: https://github.com/KnpLabs/KnpMenu/blob/master/doc/02-Twig-Integration.markdown#functions
You can use it like this:
<ol class="breadcrumb">
{% for breadcrumb_item in knp_menu_get_breadcrumbs_array(knp_menu_get_current_item('main')) %}
{% if not loop.last %}
<li><a href="{{ breadcrumb_item.uri }}">{{ breadcrumb_item.label }}</a></li>
{% else %}
<li class="active">{{ breadcrumb_item.label }}</li>
{% endif %}
{% endfor %}
</ol>
unable to make a PR but to be compatible with sf2.8+ quote the service name
arguments:
- "@knp_menu.helper"
- "@knp_menu.matcher"
because : The reserved indicator "@" cannot start a plain scalar; need to quote the scalar