我使用{% render url('fos_user_registration_register') %}
在主頁上呈現我的註冊表格。一切正常,但當用戶發送這個表單時,Symfony會將他重定向到默認的FOSUserBundle註冊頁面,這是我的問題,因爲我想在我的主頁上再次呈現此表單(帶有錯誤或成功消息)。我完全不知道該怎麼做!有可能的?FOSUserBundle - 如何在用戶登錄後在主頁上登記用戶?
我曾與登錄表單同樣的問題,但我在security.yml
使用此代碼:
firewalls:
main:
form_login:
login_path: acme__my_homepage
check_path: fos_user_security_check
failure_path: acme__my_homepage
但我不能找到上面登記選項...
我的文件:
src \ MyBundle \ Resources \ views \ homepage.html.twig
<div class="window">
{% render url('fos_user_registration_register') %}
</div>
個
應用程序\資源\ FOSUserBundle \意見\ 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>