beego 页面布局
模板
this.Layout = "admin/layout.html"
this.TplName = "admin/list.html"
在layout.html中必须有一下代码,才能显示list.html
{{.Layout.Content}}
LayoutSection
this.Layout = "layout.html" this.LayoutSections = make(map[string]string) this.LayoutSections["contentHead"] = "head.html" this.TplName = "content.html"
LayoutSections
在layout.html插入{{.contentHead}} 代替head.html