mirror of
https://github.com/astaxie/beego.git
synced 2024-11-29 12:01:28 +00:00
commit
e4fe54f6cd
14
template.go
14
template.go
@ -50,23 +50,17 @@ func ExecuteTemplate(wr io.Writer, name string, data interface{}) error {
|
|||||||
defer templatesLock.RUnlock()
|
defer templatesLock.RUnlock()
|
||||||
}
|
}
|
||||||
if t, ok := beeTemplates[name]; ok {
|
if t, ok := beeTemplates[name]; ok {
|
||||||
|
var err error
|
||||||
if t.Lookup(name) != nil {
|
if t.Lookup(name) != nil {
|
||||||
err := t.ExecuteTemplate(wr, name, data)
|
err = t.ExecuteTemplate(wr, name, data)
|
||||||
if err != nil {
|
|
||||||
logs.Trace("template Execute err:", err)
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
} else {
|
} else {
|
||||||
err := t.Execute(wr, data)
|
err = t.Execute(wr, data)
|
||||||
if err != nil {
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logs.Trace("template Execute err:", err)
|
logs.Trace("template Execute err:", err)
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
panic("can't find templatefile in the path:" + name)
|
panic("can't find templatefile in the path:" + name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user