4 Returns a list containing an arithmetic progression of integers:
8 {% for i in range(0, 3) %}
12 {# outputs 0, 1, 2, 3, #}
14 When step is given (as the third parameter), it specifies the increment (or
15 decrement for negative values):
19 {% for i in range(0, 6, 2) %}
23 {# outputs 0, 2, 4, 6, #}
27 Note that if the start is greater than the end, ``range`` assumes a step of
32 {% for i in range(3, 0) %}
36 {# outputs 3, 2, 1, 0, #}
38 The Twig built-in ``..`` operator is just syntactic sugar for the ``range``
39 function (with a step of ``1``, or ``-1`` if the start is greater than the end):
49 The ``range`` function works as the native PHP `range`_ function.
54 * ``low``: The first value of the sequence.
55 * ``high``: The highest possible value of the sequence.
56 * ``step``: The increment between elements of the sequence.
58 .. _`range`: https://secure.php.net/range