0
Revel中可以使用模板布局吗?例如,有一个包含{{define "main"}}{{end}}
标签的root.html。然后调用ExecuteTemplate(out, "main", nil)
http://golang.org/pkg/html/template/#Template.ExecuteTemplateRevel中的模板布局
喜欢的东西c.RenderLayout()
Revel中可以使用模板布局吗?例如,有一个包含{{define "main"}}{{end}}
标签的root.html。然后调用ExecuteTemplate(out, "main", nil)
http://golang.org/pkg/html/template/#Template.ExecuteTemplateRevel中的模板布局
喜欢的东西c.RenderLayout()
你可以定义你想进入的conf/routes文件。 然后,你可以打电话给你的名字的动作你想要的:
package controllers
import (
"github.com/revel/revel"
)
func (c Name) root() revel.Result {
c.Render()
}
的意见/姓名/ root.html
其他的方式可以是这样:
的意见/的Controler/NameAction.html
{{template "root.html" .}}
视图/ root.html
<p>bla, bla</p>