【发布时间】:2014-01-14 12:07:52
【问题描述】:
如何通过 twig 模板中的字符串索引更改数组值?我正在尝试:
{% 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
有什么想法吗?
【问题讨论】: