webCOMAND

cTemplate Flow Control Directives

There are a number of ways to control the flow of cTemplate processing, including loops and conditions.

Example

#/ for loop
#FOR($i=1; $i<=3; $i=$i+1)
    Iteration $i<br/>
#ENDFOR

#/ while loop
#ASSIGN($i, 1)
#WHILE($i<=3)
    Iteration $i<br/>
    #ASSIGN($i, $i+1)
#ENDWHILE