- ⌂ Flow Control
Repeat a block of cTemplate based on an initializer, condition and adjustment.
#FOR(initializer; condition; adjustment) ... #ENDFOR
- initializer - An expression typically used to initialize a variable, such as $i = 1
- condition - An expression that determines if the block should repeat again (TRUE) or terminate (FALSE), such as $i < 10
- adjustment - An expression typically used to update a variable that will eventually cause the condition to fail, such as $i = $i + 1
#FOR($i=1; $i<=3; $i=$i+1) Iteration $i<br/> #ENDFOR
Iteration 1 Iteration 2 Iteration 3