You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How I can create a breadcumb to current rotue if I'm at /dashboard/details?
I want to create a breadcumb which looks like this: home / dashboard / details /
Last month you've added knp_menu_get_breadcrumbs_array. Should I use this function? Can you share an example with me?
I'm trying to use it in that way:
{% set item = knp_menu_get('AppBundle:AdminMenuBuilder:sidebarMenu') %}
{% set breadcrumbs = knp_menu_get_breadcrumbs_array(item, [ 'Details']) %}
{% for breadcrumb in breadcrumbs %}
{{ dump(breadcrumb) }}
{% endfor %}
The text was updated successfully, but these errors were encountered:
@qweluke Your Menu does not contain valid ItemInterfaces. Check the doc's again to ensure you properly using the addchild() function parameters correctly. Once you do this then use the following code for a string based lowercased breadcrumbs for your menu based on your current item being Details.
use Knp\Menu\Util\MenuManipulator;
$menuManipulator = new MenuManipulator();
/* Returns a string as you never said you wanted breadcrumb links
If you want links thencopy the below function and build the links in your forked function ( getPathAsBreadcrumbLinks ) */
$breadcrumbs = $menuManipulator->getPathAsString($menu['Details'], ' / ');
//Lowercase String: Your example requested lowercase however your Labels were uppercase
$breadcrumbs = strtolower($breadcrumbs);
echo $breadcrumbs;
You can also keep up with the discussion about this topic with a current PR Breadcrumb renderer #161
So I have a menu built as shown in the example below:
How I can create a breadcumb to current rotue if I'm at /dashboard/details?
I want to create a breadcumb which looks like this:
home / dashboard / details /
Last month you've added
knp_menu_get_breadcrumbs_array
. Should I use this function? Can you share an example with me?I'm trying to use it in that way:
The text was updated successfully, but these errors were encountered: