我该如何在Twig模板中通过字符串索引更改数组的值呢?我正在尝试以下代码:
但是我遇到了一个nex错误:
我也在尝试:
但也会出现错误:
有什么想法吗?
{% do params['redirect_uri'] = 'http://site.loc/' %}
但是我遇到了一个nex错误:
Unexpected token "operator" of value "=" ("end of statement block" expected) in
BWUserBundle:User/social:sign-in-thumbs.html.twig at line 4
我也在尝试:
{% set params['redirect_uri'] = 'http://site.loc/' %}
但也会出现错误:
Unexpected token "punctuation" of value "[" ("end of statement block" expected) in
BWUserBundle:User/social:sign-in-thumbs.html.twig at line 4
有什么想法吗?
Unexpected token "punctuation" of value "." ("end of statement block" expected) in BWUserBundle:User/social:sign-in-thumbs.html.twig at line 4
- Victor Bocharsky