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)
| 3717 | // |
| 3718 | // Example: https://github.com/kataras/iris/tree/main/_examples/view/context-view-data/ |
| 3719 | func (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. |