mirror of
https://gitee.com/johng/gf
synced 2026-06-06 16:21:40 +08:00
improve template cache for ParseContent function of package gview
This commit is contained in:
@ -174,7 +174,7 @@ func (view *View) ParseContent(content string, params ...Params) (string, error)
|
||||
return "", nil
|
||||
}
|
||||
err := (error)(nil)
|
||||
key := fmt.Sprintf("%s_%v", gCONTENT_TEMPLATE_NAME, view.delimiters)
|
||||
key := fmt.Sprintf("%s_%v_%v", gCONTENT_TEMPLATE_NAME, view.delimiters, view.config.AutoEncode)
|
||||
tpl := templates.GetOrSetFuncLock(key, func() interface{} {
|
||||
if view.config.AutoEncode {
|
||||
return htmltpl.New(gCONTENT_TEMPLATE_NAME).Delims(view.delimiters[0], view.delimiters[1]).Funcs(view.funcMap)
|
||||
|
||||
Reference in New Issue
Block a user