[
https://issues.apache.org/jira/browse/VELOCITY-762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12903450#action_12903450
]
Nathan Bubna commented on VELOCITY-762:
---------------------------------------
Yes, that too was noticed and fixed.
> $foreach.first and $foreach.last do not have assigned values
> ------------------------------------------------------------
>
> Key: VELOCITY-762
> URL: https://issues.apache.org/jira/browse/VELOCITY-762
> Project: Velocity
> Issue Type: Bug
> Components: Engine
> Affects Versions: 1.7-beta1
> Reporter: Sergiy Kovalchuk
> Fix For: 1.7, 2.0
>
>
> $foreach.first and $foreach.last are not getting assigned in a loop (while
> isFirst() and isLast() do) .
> Test case:
> #foreach($i in [1..3])
> index = $foreach.index,
> count = $foreach.count,
> first = $foreach.isFirst() / $foreach.first,
> last = $foreach.isLast() / $foreach.last<br/>
> #end
> Result:
> index = 0, count = 1, first = true / $foreach.first, last = false /
> $foreach.last
> index = 1, count = 2, first = false / $foreach.first, last = false /
> $foreach.last
> index = 2, count = 3, first = false / $foreach.first, last = false /
> $foreach.last
--
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: [email protected]
For additional commands, e-mail: [email protected]