2

I'm using KnpMenuBudle in two different bundles of the same application. In one bundle I use also BraincraftedBootstrapBundle, so in my app/config/config.yml I put this specific config to style menus with bootstrap:

knp_menu:
  twig:
    template: "BraincraftedBootstrapBundle:Menu:menu.html.twig"

The problem is that configuration is set globally, so when i try to use KnpMenu in the bundle that doesn't require bootstrap I get an error.

How can I set this specific configuration for one bundle only?

Manuel Bitto
  • 5,073
  • 6
  • 39
  • 47

1 Answers1

2

I believe you can specify the template you want when you call the knp_menu_render twig method in your layout:

{{ knp_menu_render('main', {'template': 'BraincraftedBootstrapBundle:Menu:menu.html.twig'}, 'custom') }}
Mike
  • 2,334
  • 1
  • 23
  • 27