Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

numeric loop in volt

Tags:

php

phalcon

volt

I have read the volt documentation in phalcon page and i cant find any example for this...

You can make easy loops in objects, for example, in php:

foreach($pages as $page){
    echo $page->title;
} 

in volts would be ...

{% for page in pages %}
    {{ page.title }}
{% endfor %}

My question is, how i can make a normal numerical loop in volt? For example:

for($n=1;$n<10;$n++){
    echo $n;
}

Thanks.

like image 475
Stefan Luv Avatar asked Feb 20 '14 22:02

Stefan Luv


1 Answers

This will count from 1 to 10

{% for i in 1..10 %}
    {{ i }}
{% endfor %}
like image 189
redshark1802 Avatar answered Oct 22 '22 04:10

redshark1802