Symfony 无法覆盖KnpMenuBundle模板

Symfony 无法覆盖KnpMenuBundle模板,symfony,knpmenubundle,Symfony,Knpmenubundle,使用…MyBundle\Resources\views\Menu\knp_Menu.html.twig,删除对呈现的菜单没有影响。删除标记是为了删除内联列表元素之间的空间。我遵循了中提供的建议,包括那篇文章底部提到的{%import'knp_menu.html.twig'作为knp_menu%}。这是因为knp_menu.html.twig已经扩展了knp_menu_base.html.twig吗?还是什么 layout.html.twig: 用户菜单操作: userMenu.html.twig

使用…MyBundle\Resources\views\Menu\knp_Menu.html.twig,删除对呈现的菜单没有影响。删除标记是为了删除内联列表元素之间的空间。我遵循了中提供的建议,包括那篇文章底部提到的{%import'knp_menu.html.twig'作为knp_menu%}。这是因为knp_menu.html.twig已经扩展了knp_menu_base.html.twig吗?还是什么

layout.html.twig: 用户菜单操作: userMenu.html.twig 答案很深。对模板进行全局覆盖所需的全部工作就是修改config.yml

config.yml:
您能在模板中的输出菜单中添加您使用的源代码吗?@SpiRi7:上面添加的代码。
...
{{ render(controller('VolVolBundle:Default:userMenu')) }}
...
$user = $this->getUser();
$tool = $this->container->get('vol.toolbox');
$type = $tool->getUserType($user);
return $this->render(
                'VolVolBundle:Default:userMenu.html.twig', array('type' => $type)
);
...
{% if type is not null %}
    {% set menu = "VolVolBundle:Builder:"~type~"Menu" %}
    {{ knp_menu_render(menu) }}
{% endif %}
...
knp_menu:
    twig:  # use "twig: false" to disable the Twig extension and the TwigRenderer
        template: VolVolBundle:Menu:knp_menu.html.twig
...