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

Method Layout

core/router/api_builder.go:1813–1823  ·  view source on GitHub ↗

Layout overrides the parent template layout with a more specific layout for this Party. It returns the current Party. The "tmplLayoutFile" should be a relative path to the templates dir. Usage: app := iris.New() app.RegisterView(iris.$VIEW_ENGINE("./views", ".$extension")) my := app.Party("/my").L

(tmplLayoutFile string)

Source from the content-addressed store, hash-verified

1811//
1812// Examples: https://github.com/kataras/iris/tree/main/_examples/view
1813func (api *APIBuilder) Layout(tmplLayoutFile string) Party {
1814 handler := func(ctx *context.Context) {
1815 ctx.ViewLayout(tmplLayoutFile)
1816 ctx.Next()
1817 }
1818
1819 api.Use(handler)
1820 api.UseError(handler)
1821
1822 return api
1823}

Callers

nothing calls this directly

Calls 4

UseMethod · 0.95
UseErrorMethod · 0.95
ViewLayoutMethod · 0.80
NextMethod · 0.80

Tested by

no test coverage detected