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.

for

Summary

Creates a generic for loop.

Usage

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

Description

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.

Examples

Example 1

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

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)


Comments

There are no comments.