1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-08 12:31:58 +00:00

Full support of the http.FileSystem on all view engines as requested at #1575

Also, the HandleDir accepts both string and http.FileSystem (interface{}) (like the view's fs)
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-09-05 08:34:09 +03:00
parent 7e6d453dad
commit e1f25eb098
50 changed files with 1613 additions and 1226 deletions

View File

@@ -19,6 +19,21 @@ type (
EngineFuncer = context.ViewEngineFuncer
)
// ErrNotExist reports whether a template was not found in the parsed templates tree.
type ErrNotExist struct {
Name string
IsLayout bool
}
// Error implements the `error` interface.
func (e ErrNotExist) Error() string {
title := "template"
if e.IsLayout {
title = "layout"
}
return fmt.Sprintf("%s '%s' does not exist", title, e.Name)
}
// View is responsible to
// load the correct templates
// for each of the registered view engines.