symfony - Unable to override KnpMenuBundle template -


with ...mybundle\resources\views\menu\knp_menu.html.twig, deleting </li> has no effect on rendered menu. (removing tag done remove space between inline list elements.) have followed advice provided in this answer, including {% import 'knp_menu.html.twig' knp_menu %} mentioned toward bottom of post. because knp_menu.html.twig extends knp_menu_base.html.twig? or what?

layout.html.twig:

... {{ render(controller('volvolbundle:default:usermenu')) }} ... 

usermenuaction:

$user = $this->getuser(); $tool = $this->container->get('vol.toolbox'); $type = $tool->getusertype($user); return $this->render(                 'volvolbundle:default:usermenu.html.twig', array('type' => $type) ); 

usermenu.html.twig

... {% if type not null %}     {% set menu = "volvolbundle:builder:"~type~"menu" %}     {{ knp_menu_render(menu) }} {% endif %} 

the answer found deep in here. that's required global override of template modify config.yml.

config.yml:

... knp_menu:     twig:  # use "twig: false" disable twig extension , twigrenderer         template: volvolbundle:menu:knp_menu.html.twig ... 

Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -