mirror of
https://github.com/kataras/iris.git
synced 2025-03-14 10:56:29 +01:00
This commit is contained in:
parent
6f91e6c588
commit
69a4f11718
3
iris.go
3
iris.go
|
@ -262,6 +262,7 @@ func (s *Framework) initialize() {
|
||||||
// prepare the templates if enabled
|
// prepare the templates if enabled
|
||||||
if !s.Config.DisableTemplateEngines {
|
if !s.Config.DisableTemplateEngines {
|
||||||
|
|
||||||
|
s.templates.reload = s.Config.IsDevelopment
|
||||||
// check and prepare the templates
|
// check and prepare the templates
|
||||||
if len(s.templates.engines) == 0 { // no template engine is registered, let's use the default
|
if len(s.templates.engines) == 0 { // no template engine is registered, let's use the default
|
||||||
s.UseTemplate(html.New())
|
s.UseTemplate(html.New())
|
||||||
|
@ -270,8 +271,6 @@ func (s *Framework) initialize() {
|
||||||
if err := s.templates.loadAll(); err != nil {
|
if err := s.templates.loadAll(); err != nil {
|
||||||
s.Logger.Panic(err) // panic on templates loading before listening if we have an error.
|
s.Logger.Panic(err) // panic on templates loading before listening if we have an error.
|
||||||
}
|
}
|
||||||
|
|
||||||
s.templates.reload = s.Config.IsDevelopment
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// listen to websocket connections
|
// listen to websocket connections
|
||||||
|
|
|
@ -276,6 +276,8 @@ func (t *templateEngines) loadAll() error {
|
||||||
e.location.extension = DefaultTemplateExtension // the default file ext .html
|
e.location.extension = DefaultTemplateExtension // the default file ext .html
|
||||||
}
|
}
|
||||||
|
|
||||||
|
e.reload = t.reload // update the configuration every time a load happens
|
||||||
|
|
||||||
if err := e.load(); err != nil {
|
if err := e.load(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user