I am trying to create a for loop in a play framework template like this :
开发者_如何转开发 <ul>
#{list items:1..${pageCount}, as:i}
<li> <a href="#">${i}</a></li>
#{/list}
</ul>
How ever , it can not work because of this: items:1..${result.count} . I there a way of achieving the same:
Context: I am implementing pagination and i need to create a link that will take the user to the specified page. May be there is a 'play' way or achieving the same.
Just remove ${} from pageCount :
#{list items:1..pageCount, as:'i'}
${i} ${i.id} ${i.price}
#{/list}
精彩评论