1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-23 03:45:56 +00:00

Update to 6.0.7

This commit is contained in:
Gerasimos (Makis) Maropoulos
2017-01-10 08:54:39 +02:00
parent c476fe8921
commit 893271bf02
8 changed files with 59 additions and 29 deletions

View File

@@ -27,6 +27,8 @@ type (
// so, you can change the filenameOrSource, the page binding, the options, and even add cookies, session value or a flash message through ctx
// the return value of a PreRender is a boolean, if returns false then the next PreRender will not be executed, keep note
// that the actual context's Render will be called at any case.
//
// Example: https://github.com/iris-contrib/examples/tree/master/template_engines/template_prerender
PreRender func(ctx *Context, filenameOrSource string, binding interface{}, options ...map[string]interface{}) bool
)
@@ -74,9 +76,12 @@ func (t *templateEngines) render(isFile bool, ctx *Context, filenameOrSource str
}
if len(t.prerenders) > 0 {
for i := range t.prerenders {
// I'm not making any checks here for performance reasons, means that
// if binding is pointer it can be changed, otherwise not.
if shouldContinue := t.prerenders[i](ctx, filenameOrSource, binding, options...); !shouldContinue {
break
}