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>
Doesn't work for me...Why this shows only root not matched child of Item...in MenuExtension.php in method retrieveCurrentItem in line 70 "if" statement always return only root...removing this and adding else{ return $item } in line 82 . Make this working