mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 13:00:54 +00:00
Merge pull request #1765 from saturn4er/fix_layout_rebuild_in_dev
Add layout rebuilding on each request in dev mode
This commit is contained in:
commit
686d2e834e
@ -229,7 +229,9 @@ func (c *Controller) renderTemplate() (bytes.Buffer, error) {
|
||||
}
|
||||
if BConfig.RunMode == DEV {
|
||||
buildFiles := []string{c.TplName}
|
||||
if c.Layout != "" && c.LayoutSections != nil {
|
||||
if c.Layout != "" {
|
||||
buildFiles = append(buildFiles, c.Layout)
|
||||
if c.LayoutSections != nil {
|
||||
for _, sectionTpl := range c.LayoutSections {
|
||||
if sectionTpl == "" {
|
||||
continue
|
||||
@ -237,6 +239,7 @@ func (c *Controller) renderTemplate() (bytes.Buffer, error) {
|
||||
buildFiles = append(buildFiles, sectionTpl)
|
||||
}
|
||||
}
|
||||
}
|
||||
BuildTemplate(BConfig.WebConfig.ViewsPath, buildFiles...)
|
||||
}
|
||||
return buf, executeTemplate(&buf, c.TplName, c.Data)
|
||||
|
Loading…
Reference in New Issue
Block a user