Last active
December 17, 2015 18:48
-
-
Save lmejiahn/5655386 to your computer and use it in GitHub Desktop.
Symfony2: Example of how can we after login, redirect to the original page after login.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form class="form-signin" action="{{ path("fos_user_security_check") }}" method="post"> | |
<h2 class="form-signin-heading">Conectarse</h2> | |
<input type="hidden" name="_csrf_token" value="{{ csrf_token }}" /> | |
<div class="control-group"> | |
<div class="controls"> | |
<input type="text" class="input-block-level" id="username" name="_username" value="{{ last_username }}" required="required" placeholder="Usuario" /> | |
</div> | |
</div> | |
<div class="control-group"> | |
<div class="controls"> | |
<input type="password" class="input-block-level" id="password" name="_password" required="required" placeholder="Contraseña" /> | |
</div> | |
</div> | |
<hr> | |
<input type="hidden" name="_target_path" value="{{ app.request.headers.get('referer') }}" /> | |
<input type="submit" class="btn btn-large btn-block btn-primary" id="_submit" name="_submit" value="{{ 'security.login.submit'|trans({}, 'FOSUserBundle') }}" /> | |
{% if error %} | |
<div>{{ error|trans({}, 'FOSUserBundle') }}</div> | |
{% endif %} | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment