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

Embrace the feature request for per-party layout https://github.com/kataras/iris/issues/180

This commit is contained in:
Makis Maropoulos
2016-06-14 20:29:01 +03:00
parent d837381b16
commit 6a77c2ed22
3 changed files with 29 additions and 4 deletions

View File

@@ -163,6 +163,8 @@ func (t *Template) Render(ctx context.IContext, name string, binding interface{}
_layout := ""
if len(layout) > 0 {
_layout = layout[0]
} else if layoutFromCtx := ctx.GetString(config.TemplateLayoutContextKey); layoutFromCtx != "" {
_layout = layoutFromCtx
}
if _layout == "" {
_layout = t.Layout