3
我正在嘗試創建一個只能容納其他視圖可以使用的可重用HTML塊的視圖。想知道如果這樣的事情是可能的:通用模板庫
在views.home.common.scala.html:
@component1 = {
some common html
}
@component2 = {
some other stuff
}
在views.home.sample.scala.html:
@(user:User)
import home._
@component1
@common.component2
還沒有任何運氣迄今爲止,我沒有看到樣品中類似的事情,但這個想法被覆蓋在Template common use cases。