Félix Fort Félix Fort - 3 years ago 609
Twig Question

symfony 3 render controller in twig

in twig template

{{ render(controller('FOSUserBundle:SecurityController:login',{})) }}


An exception has been thrown during the rendering of a template ("The
_controller value "FOSUserBundle:SecurityController:login" maps to a "FOS\UserBundle\Controller\SecurityControllerController" class, but
this class was not found. Create this class or check the spelling of
the class and its namespace.")

how declare use namespace in twig template ? Thanks

Answer Source

Remove 'controller' from the render, like this :

{{ render(controller('FOSUserBundle:Security:login',{})) }}

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download