I'm currently studying phalcon and volt for a project. Anyone knows how to access dynamically the variables in the view page?
For example, I have this in my controller
$arr = array('a','b','c','d');
foreach($arr as $name)
{
$this->view->$name = constant($name);
}
$this->view->arr = $arr;
$this->view->$name , I want to get the value assigned to the $name in the volt view.
I have this in my view,
{% for name in arr%}
<div>
<label>{{ name }}</label>
<span>{{ name }}</span>
</div>
{% endfor %}
It displays both "a", but what i need is if $a = 'Test' it should display "a" in the label and "Test" in the value.