Class For

  • All Implemented Interfaces:
    Cloneable, DirectiveConstants

    public class For
    extends Foreach
    The #for directive provides the behavior of the #foreach directive but also provides an 'index' keyword that allows the user to define an optional index variable that tracks the loop iterations. e.g.; #for($user in $users index $i). As $user iterates through $users the index reference $i will be equal to 0, 1, 2, etc..
    See Also:
    Foreach