How to get index for "for loop" in scala template?

Showing 1-3 of 3 messages
How to get index for "for loop" in scala template? Roman Bykovskiy 3/14/12 7:01 AM
How can I get index for "for loop" in scala template?
Can't even reassign value to varable to make independed counter (
Not enough documentation on this!
Re: [play-framework] How to get index for "for loop" in scala template? Julien Richard-Foy 3/14/12 8:07 AM
See zipWithIndex method of scala iterables:
http://www.scala-lang.org/api/current/index.html#scala.collection.Iterable
Re: How to get index for "for loop" in scala template? Leonard Punt 3/14/12 8:09 AM
I assume this is a Play2.0 question, isn't it?

I think this is what you need:

@for(for(i <- 0 to list.size-1) {
    @list(i)
}

or simply:

@for(i <- list.indices) {

  @list(i)
}