Answer the question
In order to leave comments, you need to log in
How to access an array in a twig template through a variable set in twig?
Good evening . The controller has
foreach($data['polls'] as $poll){
$data["count"][$i]=$this->model_poll_poll->getCount($i);
$i++;
}
{% set j = 0 %}
{% for poll in polls %}
<input type="radio" name="poll" value="{{ poll }}" /> {{ poll }} {{count}}.{{j}} <br />
{% set j = j + 1 %}
{% endfor %}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question