我为我的申请创造了一个开端。
I can t figure how to get current route / tell if the page / "Call" is active.
The Code in index.scala.html
@if(page.getTotalPageCount() > 0){
<div class="pagination">
<ul>
@for(i <- 0 to page.getTotalPageCount()-1){
<li@if(@routes.NewsHandler.index(i) == ?){ class="active"}><a href="@routes.NewsHandler.index(i)">@(i+1)</a></li>
}
</ul>
</div>
}
基本上如此。
if(@routes.NewsHandler.index(i) == ?){ class="active"}
任何想法?
EDIT, i found a working solution:
@if(request().path().toString().equals(routes.NewsHandler.index(i).toString())){ class="active"}