MCPcopy Create free account
hub / github.com/kataras/iris / FallbackView

Method FallbackView

core/router/api_builder.go:1786–1793  ·  view source on GitHub ↗

FallbackView registers one or more fallback views for a template or a template layout. Usage: FallbackView(iris.FallbackView("fallback.html")) FallbackView(iris.FallbackViewLayout("layouts/fallback.html")) OR FallbackView(iris.FallbackViewFunc(ctx iris.Context, err iris.ErrViewNotExist) error {

(provider context.FallbackViewProvider)

Source from the content-addressed store, hash-verified

1784// [...custom logic e.g. ctx.View("fallback", err.Data)]
1785// })
1786func (api *APIBuilder) FallbackView(provider context.FallbackViewProvider) {
1787 handler := func(ctx *context.Context) {
1788 ctx.FallbackView(provider)
1789 ctx.Next()
1790 }
1791 api.Use(handler)
1792 api.UseError(handler)
1793}
1794
1795// Layout overrides the parent template layout with a more specific layout for this Party.
1796// It returns the current Party.

Callers

nothing calls this directly

Calls 4

UseMethod · 0.95
UseErrorMethod · 0.95
NextMethod · 0.80
FallbackViewMethod · 0.65

Tested by

no test coverage detected