How to set array value in twig template

后端 未结 1 953
自闭症患者
自闭症患者 2021-01-20 01:17

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

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

but

1条回答
  •  旧巷少年郎
    2021-01-20 01:47

    what about,

    {% set params = params|merge({'redirect_uri': 'http://site.loc/'}) %}
    

    0 讨论(0)
提交回复
热议问题