Groups
Groups
Sign in
Groups
Groups
Play Framework [deprecated]
Conversations
About
Send feedback
Help
How to get index for "for loop" in scala template?
3,490 views
Skip to first unread message
Roman Bykovskiy
unread,
Mar 14, 2012, 10:01:19 AM
3/14/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to play-fr...@googlegroups.com
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!
Julien Richard-Foy
unread,
Mar 14, 2012, 11:07:41 AM
3/14/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to play-fr...@googlegroups.com
See zipWithIndex method of scala iterables:
http://www.scala-lang.org/api/current/index.html#scala.collection.Iterable
Leonard Punt
unread,
Mar 14, 2012, 11:09:34 AM
3/14/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to play-fr...@googlegroups.com
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)
}
Reply all
Reply to author
Forward
0 new messages