title: Override KnpMenu submenu items
body: <p>I have made a menu with KnpMenu and I'm trying to override the submenu</p>
  
  <p>This is how I add submenu items</p>
  
  <pre><code>$menu
      -&gt;addChild('sidebar.front.servers', ['route' =&gt; 'server_index'])
      -&gt;setExtras([
          'icon'               =&gt; 'fa fa-hdd-o',
          'regex'              =&gt; '#^/servers/#',
      ])
  ;
  $menu['sidebar.front.servers']
      -&gt;addChild('nnanana', ['route' =&gt; 'server_index'])
  ;
  </code></pre>
  
  <p>I searched on the <code>knp_menu.html.twig</code> to find what is rendering the submenu.</p>
  
  <p>I have find this who render submenu list and items.</p>
  
  <pre><code>{% block list %}
      {% if item.hasChildren and options.depth is not same as(0) and item.displayChildren %}
          {% import _self as knp_menu %}
          &lt;ul{{ knp_menu.attributes(listAttributes) }}&gt;
              {{ block('children') }}
          &lt;/ul&gt;
       {% endif %}
  {% endblock %}
  
  {% block children %}
      {# save current variables #}
      {% set currentOptions = options %}
      {% set currentItem = item %}
      {# update the depth for children #}
      {% if options.depth is not none %}
          {% set options = options|merge({'depth': currentOptions.depth - 1}) %}
      {% endif %}
      {# update the matchingDepth for children #}
      {% if options.matchingDepth is not none and options.matchingDepth &gt; 0 %}
      {% set options = options|merge({'matchingDepth': currentOptions.matchingDepth - 1}) %}
      {% endif %}
      {% for item in currentItem.children %}
          {{ block('item') }}
      {% endfor %}
      {# restore current variables #}
      {% set item = currentItem %}
      {% set options = currentOptions %}
  {% endblock %}
  </code></pre>
  
  <p>This put classes on submenu list.</p>
  
  <pre><code>{%- set childrenClasses = item.childrenAttribute('class') is not empty ? [item.childrenAttribute('class')] : [] %}
  {%- set childrenClasses = childrenClasses|merge(['menu_level_' ~ item.level]) %}
  {%- set listAttributes = item.childrenAttributes|merge({'class': childrenClasses|join(' ') }) %}
  </code></pre>
  
  <p>This render all the submenu items</p>
  
  <pre><code>{{ block('list') }}
  </code></pre>
  
  <p>But when I'm trying to override this block in my template, like this</p>
  
  <pre><code>{% block item %}
      {% import 'knp_menu.html.twig' as knp_menu %}
      &lt;a href="#"&gt;test&lt;/a&gt;
  {% endblock %}
  </code></pre>
  
  <p>This is not working and menu is not rendered anymore, I only have <code>test</code>  displayed...</p>
  
  <p>I do exactly the same to override every menu items and this work.</p>
  
  <p>How can I override this submenu ?</p>
  
  <p>Thanks</p>