开发者

Play framework template For Loop

开发者 https://www.devze.com 2023-02-16 00:11 出处:网络
I am trying to create a for loop in a play framework template like this : 开发者_如何转开发 <ul>

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

精彩评论

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