I'm upgrading my project from Symfony 2.0.22 to 2.2.0 and review somes changes, but i'm blocked on this :
I would like to render (like in Sf 2.0.X) a header with their controller and the "render" twig method don't work for me. Their is the error :
An exception has been thrown during the rendering of a template ("No route found for "GET Index:header"") in "OSSiteBundle:Index:index.html.twig".
Here is the actual render method :
{# src/OS/SiteBundle/Resources/views/layout.html.twig #}
...
{% render "OSSiteBundle:Index:header" with {'thisid' : block('thisid'), ... } %}
I tried :
{{ render('OSSiteBundle:Index:header' , {'thisid' : block('thisid'), 'thistitle' : block('thistitle'), 'thisunderpageid' : block('thisunderpageid'), 'thisbackground' : block('thisbackground') }) }}
{{ include("OSSiteBundle:Index:header.html.twig", {'thisid' : block('thisid'), 'thistitle' : block('thistitle'), 'thisunderpageid' : block('thisunderpageid'), 'thisbackground' : block('thisbackground') }) }}
=> The last one work but the Controller isn't colled in this way
I tried even a render with a path in routing.yml... I have no other idea help me please!
In Symfony >= 2.2.x you should embed your controller like this:
{{ render(controller('AcmeArticleBundle:Article:recentArticles', { 'max': 3 })) }}
Take a look at the documentation: