castleproject / NVelocity

Castle's NVelocity
Other
57 stars 33 forks source link

$foreach.hasNext invalid #17

Open SFlyers opened 4 years ago

SFlyers commented 4 years ago

version 1.1.1

jonorossi commented 4 years ago

@PettyHandSome is there a question? I don't know what hasNext is.

SFlyers commented 4 years ago

directive.foreach.iterator.name

SFlyers commented 4 years ago

How to judge the end of foreach loop?

jonorossi commented 4 years ago

In NVelocity (which is a port of Velocity from about 15 years ago) we've got directive.foreach.counter.name which is by default named velocityCount (1-based), you could compare its value against your collection's length.

The other option is to use the #afterall section (see the docs).

SFlyers commented 4 years ago

In NVelocity (which is a port of Velocity from about 15 years ago) we've got directive.foreach.counter.name which is by default named velocityCount (1-based), you could compare its value against your collection's length.

The other option is to use the #afterall section (see the docs).

OK.Thanks