Question

I am using the FOSUserBundle in my Symfony application, I have the login and register forms in a separate template. I want both in one template to display them next to each other.

plz help me save my day !!

Was it helpful?

Solution

1 You need to have a first controller with a loginAction that renders a login.html.twig template. Let's assume this controller is AcmeUserBundle:Security:login.

2 You need to have a second controller with a registerAction that renders a register.html.twig template. Let's assume this controller is AcmeUserBundle:Registration:register

3 Create a third controller, for example welcomeAction that renders a welcome.html.twig template, and embed the controllers above on the same page.

{# AcmeUserBundle:Welcome:welcome.html.twig #}

{{ render(controller('AcmeUserBundle:Security:login'})) }}
{{ render(controller('AcmeUserBundle:Registration:register'})) }}

See here for more informations on how to embed controllers.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top