Symfony 2.0 KnpMenu custom template
icons, knpmenu, menu, symfony
Solution
this was quite simple:
{{ knp_menu_render('AlefDemoBundle:Builder:mainMenu', { 'template': 'AlefDemoBundle:Menu:knp_main_menu.html.twig' }) }}
inside twig template.
Problem
Im trying to modify template from knpMenu. I renamed it to `knp_main_menu.html.twig` config.yml: ``` knp_menu: twig: template: knp_main_menu.html.twig templating: true default_renderer: twig ``` `knp_menu.html.twig` works but my file (exact copy of the original) does not. Is there any way to do this? My final goal is to make template that works with icons: for example: ``` $menu->addChild('Grupy', array( 'route' => 'group', 'attributes' => array( 'title' => 'Dodaj nową grupę', 'data-icon' => 'group', 'data-id' => 'groups_list', ) )); ``` should produce something like this: ``` <ul> <li title="Dodaj nową grupę" data-id="groups_list" data-icon="group"> <a href="..."> <img src="somedir/group.png" /> Grupy </a> </li> </ul> ```