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
posted @ 2020-01-10 16:46  A毛毛  阅读(309)  评论(0编辑  收藏  举报