문제

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 !!

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top