Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-762

$foreach.first and $foreach.last do not have assigned values

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7-beta1
    • 1.7, 2.0
    • Engine
    • None

    Description

      $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

      Attachments

        Activity

          People

            Unassigned Unassigned
            serg472 Sergiy Kovalchuk
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: