Hello!
Suppose I send the following variables (bindings) to the template:
{
"var1" => 1
"var2" => "aaa"
}
And in the template I can access variables/bindings like this:
{{ var1 }}
but what if I want to get some value by the content of the variable, is there some accessor for globals, or all_variables?
{% my_key = "var2" %}
...
{{ something_like_globals[my_key] }} # error - no globals/undefined
I know how to do it for some sub-dictionary, like this:
{
"var1" => 1
"var2" => "aaa"
"var3" => { "sub" => "bbb" }
}
Then in the template I can do this:
{% my_key = "sub" %}
{{ var3[my_key} }}
But I don’t know how to reach those root bindings.
I tried looking in the documentation - but no luck.
Thanks!