0
我用playframework2.2:如何獲取playframework模板中的控制器?
我的模板是:
@(topiclink:String, head: String, rate: Int, topicid:Int, summary: String, pic_url:String)
@if(topiclink=="Shoplist"){
<a class="list-group-item" href="@routes.ShoplistController.pagelist(topicid.toString())">
}else {
<a class="list-group-item" href="@routes.PageController.pagelist(topicid.toString())">
}</a>
我想寫更多的面向對象,我的意思是我想使用的參數:
@(topiclink:Controller, head: String, rate: Int, topicid:Int, summary: String, pic_url:String)
然後就可以直接@ topiclink.pagelist(topicid.tostring())
然後,我可以直接進入對應的控制器頁面列表。