mardi 31 mars 2015

FOSUserBundle - how to hold user on homepage after he sent register form?

I render my registration form on homepage using {% render url('fos_user_registration_register') %}. Everything works fine, but when user send this form, Symfony redirect him to default FOSUserBundle registration page and it's my problem, becouse I want to render this form again (with errors or with success message) on my homepage. I completely don't know how to do it! It is possible?


I had the same problem with login form but I used this code in security.yml:



firewalls:
main:
form_login:
login_path: acme__my_homepage
check_path: fos_user_security_check
failure_path: acme__my_homepage


But I can't find above options for registration...


My files:


src\MyBundle\Resources\views\homepage.html.twig



<div class="window">
{% render url('fos_user_registration_register') %}
</div>


app\Resources\FOSUserBundle\views\register.html.twig



<form>
<input class="myCustomFormInput" name="username" />
<input class="myCustomFormInput" name="email" />
<input class="myCustomFormInput" name="password" />
<input class="myCustomFormInput" name="rpassword" />
<button type="submit">Send</button>
</form>

Aucun commentaire:

Enregistrer un commentaire