4

How I can change my array value by string index in twig template? I'm trying:

{% do params['redirect_uri'] = 'http://site.loc/' %}

but I get nex error:

Unexpected token "operator" of value "=" ("end of statement block" expected) in
BWUserBundle:User/social:sign-in-thumbs.html.twig at line 4

I also trying:

{% set params['redirect_uri'] = 'http://site.loc/' %}

but have error too:

Unexpected token "punctuation" of value "[" ("end of statement block" expected) in 
BWUserBundle:User/social:sign-in-thumbs.html.twig at line 4

Any ideas?

1 Answer 1

6

what about,

{% set params = params|merge({'redirect_uri': 'http://site.loc/'}) %}
Sign up to request clarification or add additional context in comments.

1 Comment

Unexpected token "punctuation" of value "." ("end of statement block" expected) in BWUserBundle:User/social:sign-in-thumbs.html.twig at line 4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.