{% set key = 'foobar' %}
{% set hash = { (key) : 'hello world' } %}
{% debug hash %}
prints:
array(1) { ["foobar"]=> string(11) "hello world" }
wrapping in parenthesis solves your problem.
{% set key = 'foobar' %}
{% set hash = { (key) : 'hello world' } %}
{% debug hash %}
prints:
array(1) { ["foobar"]=> string(11) "hello world" }
wrapping in parenthesis solves your problem.