diff --git a/app.go b/app.go index 8be1879f..d405fa6e 100644 --- a/app.go +++ b/app.go @@ -94,8 +94,8 @@ type Settings struct { // When set to true, it will not print out the fiber ASCII and "listening" on message DisableStartupMessage bool - // RenderEngine is the interface that wraps the Render function. - RenderEngine RenderEngine + // Templates is the interface that wraps the Render function. + Templates Templates // The amount of time allowed to read the full request including body. ReadTimeout time.Duration // default: unlimited diff --git a/ctx.go b/ctx.go index 8391bf55..c67e938b 100644 --- a/ctx.go +++ b/ctx.go @@ -65,8 +65,8 @@ type Cookie struct { SameSite string } -// RenderEngine is the interface that wraps the Render function. -type RenderEngine interface { +// Templates is the interface that wraps the Render function. +type Templates interface { Render(io.Writer, string, interface{}) error } @@ -717,9 +717,9 @@ func (ctx *Ctx) Render(name string, bind interface{}) (err error) { defer bytebufferpool.Put(buf) // Use ViewEngine if exist - if ctx.app.Settings.RenderEngine != nil { - // Render template with engine - if err := ctx.app.Settings.RenderEngine.Render(buf, name, bind); err != nil { + if ctx.app.Settings.Templates != nil { + // Render template from ViewEngine + if err := ctx.app.Settings.Templates.Render(buf, name, bind); err != nil { return err } } else {