twig - Add "Return to" to FOSUserBundle login form -


the title says everything. code have enter where?

if dont understand title, mean give template this

<a href="{{ path('fos_user'_security_login', {}|merge({'redir': 'blog_default_index'})) }}">link</a> 

and output should be... (example)

<a href="http://localhost/login?redir=http://localhost/blog/index" 

and think controller need like...

/*  * @route('/login', defaults={"redir" = "blog_default_index"})  */ 

please help. have no idea

try build href in 2 steps:

<a href="{{ path('fos_user_security_login') }}?redir={{ path('blog_default_index') }}">link</a> 

alternatively if add _target_path hidden input login form, user redirect path:

<form>     ...     <input type="hidden" name="_target_path" value="{{ path('blog_default_index') }}" /> </form> 

Comments

Popular posts from this blog

android - net_scheduler holding wakelock -

sql - MySQL : Getting Entries from a many-to-many table -

java - Retrieving data from database using jsp (Hibernate + Spring + Maven) -