2.7.11. For

This is a simple loop known from programming languages. It iterates, until the end expression is true. The instruction takes three parameters:

Table 2.10. For: parameters

For: parameters
NameTypeRequired?Description
beginExpressionYesStarting condition (i.e. iterating variable initialization).
endExpressionYesEnding condition. The loop iterates, until it is true.
iterateExpressionYesIterating expression executed every call.
separatorExpressionNoA separator inserted between two section elements. The parameter can be replaced with the separator instruction. The parameter is available since OPT 1.1.3.

Example 2.58. Displaying numbers from 1 to 10

{for begin="@a is 1" end="@a <= 10" iterate="@a++"}
<p>{@a}</p>
{/for}

This instruction can be used with separators.