beego | 页面布局

模板

this.Layout = "admin/layout.html"
this.TplName = "admin/add.html"

在layout.html中必须有一下代码,才能显示add.html

{{.Layout.Content}}

LayoutSection

this.Layout = "layout.html"
this.LayoutSections = make(map[string]string)
this.LayoutSections["contentHead"] = "head.html"
this.TplName = "content.html"

插入不同的前段代码片段

 

posted @ 2018-11-26 20:50  猴里吧唧  阅读(421)  评论(0)    收藏  举报