FOSUserBundle: embedding the login form and choosing its template

Posted by tirengarfio on Stack Overflow See other posts from Stack Overflow or by tirengarfio
Published on 2011-11-07T17:53:55Z Indexed on 2013/06/27 22:21 UTC
Read the original article Hit count: 232

Filed under:

i want to insert the login form of FOSUserBundle in my template like this:

<div id="sidebar">
     {% render "FOSUserBundle::Security::login" %}
</div> 

but not to render the template that is been calling in the code of loginAction() originally.

I have thought I'd find useful the possibility of passing the template I want to render as a parameter as 'max' in this example:

<div id="sidebar">
    {% render "AcmeArticleBundle:Article:recentArticles" with {'max':
3} %}
</div>

Is that possible in symfony2? If not..

should I create another action for my bundle with the same code inside of loginAction? or should I modify the original loginAction code and write control structures?

if(currentPage == 'home')
 renderResponse('template1')
else
renderResponse('template2')

© Stack Overflow or respective owner

Related posts about symfony2