We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Range step in Volt

Hi guys!

How build step in for range in Volt ?

My solutions (step by 5000):

{% for summ in 5000..100000 if summ % 5000 == 0 %}
    <option value="{{summ}}">{{ summ|money }}</option>
{% endfor %}

returned 5000, 10000, 15000 and etc...

But it is not beautiful. Or not?

Thanks, and sorry for my dialect :)



60.0k
Accepted
answer

Hi Alexashka,

my teacher said: "if it works is good and good is very good".

maybe a little bit cleaner to render a form: https://docs.phalcon.io/en/latest/reference/forms.html

Hope it helps you :-)

Rgds

Stefan