[ 
https://issues.apache.org/jira/browse/VELOCITY-696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674721#action_12674721
 ] 

nbubna edited comment on VELOCITY-696 at 2/18/09 10:28 AM:
-----------------------------------------------------------------

New thought.  How does this syntax look:

#foreach( $user in $users ) $user #end
#foreach[index $i]( $user in $users ) $user $i #end
#foreach[index $i, hasNext $next]( $user in $users ) $user $i $next #end

Think of it as a separation between the main function of the directive and the 
"configuration" of the directive.

      was (Author: nbubna):
    New thought.  How does this syntax look:

#foreach[index $i]( $user in $users )...#end
#foreach[index $i, hasNext $next]( $user in $users ) ... #end

Think of it as a separation between the main function of the directive and the 
"configuration" of the directive.
  
> Add index parameter to #foreach directive to define an index variable
> ---------------------------------------------------------------------
>
>                 Key: VELOCITY-696
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-696
>             Project: Velocity
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: 2.0
>            Reporter: Byron Foster
>
> Allow the following:
> #foreach($user in $users index $i)
> #end
> So that $i holds the current index number of the iteration.  This is similar 
> in functionality to the implicitly defined index variable, except this is 
> more explicit.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@velocity.apache.org
For additional commands, e-mail: dev-h...@velocity.apache.org

Reply via email to