Is it possible to access object property using variable as the property name?
$obj = new sdClass;
$obj->attr = 'some value';
$key = 'attr';
echo $obj->$key; // some value
In Volt I can't use
{{ obj[key] }}
{{ obj.key }}
Is it possible to access object property using variable as the property name?
$obj = new sdClass;
$obj->attr = 'some value';
$key = 'attr';
echo $obj->$key; // some value
In Volt I can't use
{{ obj[key] }}
{{ obj.key }}