开发者

Play framework template For Loop

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}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜