2
從一個主html模板我打電話#{doLayout}
呈現我的看法html。我想調用一個自定義html模板,例如#{happyHeader}
,我想在我的視圖html文件中定義它。事情是這樣的:如何在PlayFramework視圖內定義一個html子模板?
<html>
<body>
#{happyHeader}
<hr/>
#{doLayout}
</body>
</html>
在我index.html
有這樣的事情:
<p>My happy doLayout main content here</p>
#{define happyHeader}
<h1>Nice header</h1>
#{/}
我看了看周圍的StackOverflow,但沒有找到一個類似的問題,也不做自定義模板解決方案Play Framework文檔似乎涵蓋了這一點。