In Play! 1, it was possible to get the current index inside a loop, with the following code:
#{list items:myItems, as: 'item'}
<li>Item ${item_index} is ${item}</li>
#{/list}
Is there an equivalent in Play2, to do something like that?
@for(item <- myItems) {
<li>Item ??? is @item</li>
}
Same question for the _isLast
and _isFirst
.
ps: this question is quite similar, but the solution implied to modify the code to return a Tuple (item, index)
instead of just a list of item
.