por lo tanto copiamos el archivo login.html.twig:
mkdir src/Peteramas/MyFOSUserBundle/Resources/views/Security/ cp vendor/friendsofsymfony/user-bundle/FOS/UserBundle/Resources/views/Security/login.html.twig src/Peteramas/MyFOSUserBundle/Resources/views/Security/
y luego cambiamos su contenido de esto:
{% extends "FOSUserBundle::layout.html.twig" %} {% trans_default_domain 'FOSUserBundle' %} {% block fos_user_content %} {% if error %} <div>{{ error|trans }}</div> {% endif %} <form action="{{ path("fos_user_security_check") }}" method="post"> <input type="hidden" name="_csrf_token" value="{{ csrf_token }}" /> <label for="username">{{ 'security.login.username'|trans }}</label> <input type="text" id="username" name="_username" value="{{ last_username }}" required="required" /> <label for="password">{{ 'security.login.password'|trans }}</label> <input type="password" id="password" name="_password" required="required" /> <input type="checkbox" id="remember_me" name="_remember_me" value="on" /> <label for="remember_me">{{ 'security.login.remember_me'|trans }}</label> <input type="submit" id="_submit" name="_submit" value="{{ 'security.login.submit'|trans }}" /> </form> {% endblock fos_user_content %}
{% trans_default_domain 'FOSUserBundle' %} {% if error %} <span class="hidden" id="fosuserbundle-errors">{{ error|trans }}</span> {% endif %} <form action="{{ path("fos_user_security_check") }}" method="post" class="navbar-form navbar-right" role="form"> <div class="form-group"> <label class="sr-only" for="username">{{ 'security.login.username'|trans }}</label> <input class="form-control" id="username" name="_username" placeholder="{{ 'security.login.username'|trans }}" required="required" type="text" value="{{ last_username }}"> </div> <div class="form-group"> <label class="sr-only" for="password">{{ 'security.login.password'|trans }}</label> <input class="form-control" id="password" name="_password" placeholder="{{ 'security.login.password'|trans }}" required="required" type="password"> </div> <div class="checkbox"> <label class="text-muted"> <input id="remember_me" name="_remember_me" type="checkbox" value="on"> {{ 'security.login.remember_me'|trans }} </label> </div> <input type="hidden" name="_csrf_token" value="{{ csrf_token }}" /> <button class="btn btn-primary" id="_submit" name="_submit" type="submit">{{ 'security.login.submit'|trans }}</button> </form>
y en el layout lo renderizaremos de este modo:
{{ render(controller('FOSUserBundle:Security:login')) }}
como se vió en la Parte I
No hay comentarios.:
Publicar un comentario
Puedes comentar como te gustaría que comenten de ti.