Setting element of array from Twig

前端 未结 10 780
北恋
北恋 2020-12-04 09:55

How can I set member of an already existing array from Twig?

I tried doing it next way:

{% set arr[\'element\'] = \'value\' %}

but

10条回答
  •  再見小時候
    2020-12-04 10:40

    I had a multi dimension array. The only solution I could find out is create a new temporary array and update/add the information, which was further passed on to another twig function.

提交回复
热议问题