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

Method ViewLayout

context/context.go:3719–3721  ·  view source on GitHub ↗

ViewLayout sets the "layout" option if and when .View is being called afterwards, in the same request. Useful when need to set or/and change a layout based on the previous handlers in the chain. Note that the 'layoutTmplFile' argument can be set to iris.NoLayout to disable the layout for a specific

(layoutTmplFile string)

Source from the content-addressed store, hash-verified

3717//
3718// Example: https://github.com/kataras/iris/tree/main/_examples/view/context-view-data/
3719func (ctx *Context) ViewLayout(layoutTmplFile string) {
3720 ctx.values.Set(ctx.app.ConfigurationReadOnly().GetViewLayoutContextKey(), layoutTmplFile)
3721}
3722
3723// ViewData saves one or more key-value pair in order to be passed if and when .View
3724// is being called afterwards, in the same request.

Callers 15

indexFunction · 0.80
indexFunction · 0.80
indexFunction · 0.80
indexFunction · 0.80
indexFunction · 0.80
internalServerErrorFunction · 0.80
layoutFunction · 0.80
initAppFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
indexFunction · 0.80

Calls 3

SetMethod · 0.65
ConfigurationReadOnlyMethod · 0.65

Tested by

no test coverage detected