Commit 86528c7b authored by astaxie's avatar astaxie Committed by GitHub

Merge pull request #2030 from saturn4er/feature/add_template_prefix_field

Add template prefix field to controller
parents ce6d6739 0943ef9e
......@@ -71,6 +71,7 @@ type Controller struct {
TplName string
Layout string
LayoutSections map[string]string // the key is the section name and the value is the template name
TplPrefix string
TplExt string
EnableRender bool
......@@ -227,6 +228,9 @@ func (c *Controller) renderTemplate() (bytes.Buffer, error) {
if c.TplName == "" {
c.TplName = strings.ToLower(c.controllerName) + "/" + strings.ToLower(c.actionName) + "." + c.TplExt
}
if c.TplPrefix != "" {
c.TplName = c.TplPrefix + c.TplName
}
if BConfig.RunMode == DEV {
buildFiles := []string{c.TplName}
if c.Layout != "" {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment