1
0
mirror of https://github.com/kataras/iris.git synced 2026-03-07 08:55:57 +00:00

Implementation of https://github.com/kataras/iris/issues/412 , as requested. Read HISTORY for a code snippet

This commit is contained in:
Gerasimos Maropoulos
2016-09-29 17:05:22 +03:00
parent 4bf1d65877
commit f4b4dd0275
6 changed files with 161 additions and 40 deletions

View File

@@ -596,7 +596,7 @@ func (ctx *Context) RenderTemplateSource(status int, src string, binding interfa
// Note: the options: "gzip" and "charset" are built'n support by Iris, so you can pass these on any template engine or serialize engines
func (ctx *Context) RenderWithStatus(status int, name string, binding interface{}, options ...map[string]interface{}) (err error) {
if strings.IndexByte(name, '.') > -1 { //we have template
err = ctx.framework.templates.render(ctx, name, binding, options...)
err = ctx.framework.templates.renderFile(ctx, name, binding, options...)
} else {
err = ctx.renderSerialized(name, binding, options...)
}