symfony - Custom FOSUserBundle Login Template using Bootstrap -


I have installed Symfony2, FOS User Bundle and Twitter Bootstrap.

Then I / App Setup / Resources / FOSUserBundle / views / layout.html. Use my site template to override the FOSUserBundle template.

If I have a link to the homepage / login then it all works.

> Now I want to implement a template where the login form is part of the main template.

I want to use it in the closest main template:

 I can override the layout html to not expand the main code, but it can style / styling all the styles Removes    {% render controller ("FOSUserBundle: Security: login")%}  

/ P>

Any ideas how I both Can handle the scenarios?

You were almost there :)

You can use any of the render functions Can include login form in other template.

<% 2> <% 2> <% s>
Visit / Security / Launamatma To create the T vig and the FOSUser bundle wrapping {% block fos_user_content%} to return this form directly:

  {% error% } And 
gt; {{Error | Trans}} & lt; / Div & gt; {% Endif%} & lt; Form action = "{{path (" fos_user_security_check ")}}" method = "post" & gt; & Lt; Input type = "hidden" name = "_ csrf_token" value = "{{csrf_token}}" /> & Lt; Label = "username" & gt; {{'Security.login.username' | Trans}} for label & gt; Label & gt; & Lt; Input type = "text" id = "user name" name = "_ username" value = "{{last_username}}" required = "required" /> & Lt; Label = "password" & gt; {{'Security.login.password' | Trans}} for label & lt; / Label & gt; & Lt; Input type = "password" id = "password" name = "_ password" required = "required" /> & Lt; Input type = "checkbox" id = "remember_me" name = "_ remember_me" value = "on" /> & Lt; Label = "remember_me" & gt; {{'Security.login.remember_me' | Trans}} for label & gt; Label & gt; & Lt; Input type = "submit" id = "_ submit" name = "_ submit" value = "{{'security.login.submit' | trans}}" /> & lt; / Form & gt;

Then adjust it to fit your template.


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -