mirror of
https://github.com/kataras/iris.git
synced 2026-01-24 20:35:59 +00:00
minor fixes on jet and pug view engines
This commit is contained in:
10
view/html.go
10
view/html.go
@@ -34,6 +34,8 @@ type HTMLEngine struct {
|
||||
|
||||
//
|
||||
middleware func(name string, contents []byte) (string, error)
|
||||
onLoad func()
|
||||
onLoaded func()
|
||||
Templates *template.Template
|
||||
customCache []customTmp // required to load them again if reload is true.
|
||||
bufPool *sync.Pool
|
||||
@@ -250,6 +252,10 @@ func (s *HTMLEngine) Load() error {
|
||||
}
|
||||
|
||||
func (s *HTMLEngine) load() error {
|
||||
if s.onLoad != nil {
|
||||
s.onLoad()
|
||||
}
|
||||
|
||||
if err := s.reloadCustomTemplates(); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -284,6 +290,10 @@ func (s *HTMLEngine) load() error {
|
||||
return s.parseTemplate(path, buf, nil)
|
||||
})
|
||||
|
||||
if s.onLoaded != nil {
|
||||
s.onLoaded()
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user