1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-03 10:17:03 +00:00

New feature: Fallback views. Read HISTORY.md

This commit is contained in:
Gerasimos (Makis) Maropoulos
2021-01-24 14:08:37 +02:00
parent a2588e480d
commit 435f284815
16 changed files with 316 additions and 44 deletions

View File

@@ -1,6 +1,26 @@
package context
import "io"
import (
"fmt"
"io"
)
// ErrViewNotExist it's an error.
// It reports whether a template was not found in the parsed templates tree.
type ErrViewNotExist struct {
Name string
IsLayout bool
Data interface{}
}
// Error completes the `error` interface.
func (e ErrViewNotExist) Error() string {
title := "template"
if e.IsLayout {
title = "layout"
}
return fmt.Sprintf("%s '%s' does not exist", title, e.Name)
}
// ViewEngine is the interface which all view engines should be implemented in order to be registered inside iris.
type ViewEngine interface {