Let's say I have two variables passed to a template: var_a
and var_b
. Is there a way to address them dynamically, or in other words construct the variable name from strings? Something like PHP's $$var_name
.
For example if i have a letter
variable with holds the value a
or b
, I'd like to render var_a
by writing something like:
{{"var_"|some_sort_of_concat:letter}}
and get the value of var_a
or var_b
depending on the value of letter
. Is such a thing possible?