Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.



Creates a generic for loop.


{for <number> to <number> as $itemVar [ sequence <array> as $seqVar ]}
    [ {delimiter}...{/delimiter}]
    [ {break}    ]
    [ {continue} ]
    [ {skip}     ]


This mechanism makes it possible to do generic looping. It supports looping over numerical ranges in both directions. In addition it also supports breaking, continual and skipping.


Example 1

{for 0 to 7 as $counter}
    Value of counter: {$counter} <br />

The following output will be produced:

Value of counter: 0
Value of counter: 1
Value of counter: 2
Value of counter: 3
Value of counter: 4
Value of counter: 5
Value of counter: 6
Value of counter: 7

Balazs Halasy (22/02/2005 1:10 pm)

Balazs Halasy (28/04/2005 8:30 am)


There are no comments.