1

I would like to use my own template to create my custom website menu with Knp Menu.

I find how to specify a different template, using this:

{{ knp_menu_render('main', {'template' : 'custom_knp_menu.html.twig'}) }}

But now, I have no idea how to retrieve all the item list inside the template. I guess they are defined in some place but I can't find them.

Thanks for your help.

Minirock
  • 628
  • 3
  • 13
  • 28

1 Answers1

1

I found the parameter I was looking for was {{ item }}.

I used this on top of the templates to find out.

{% for key, value in _context  %}
  <li>{{ key }}</li>
{% endfor %}
Minirock
  • 628
  • 3
  • 13
  • 28