iris/_examples/view/quicktemplate/controllers/execute_template.go
Gerasimos (Makis) Maropoulos d697426cb6 minor
Change the new ctx.Compres to ctx.CompressWriter and iris.Compress and iris.CompressReader as one iris.Compression

Update the README example

(master development branch)


Former-commit-id: fb67858fe5be5662b5816df41020c28ff9a8c6f6
2020-07-20 13:36:39 +03:00

15 lines
380 B
Go

package controllers
import (
"github.com/kataras/iris/v12/_examples/view/quicktemplate/templates"
"github.com/kataras/iris/v12"
)
// ExecuteTemplate renders a "tmpl" partial template to the `Context.ResponseWriter`.
func ExecuteTemplate(ctx iris.Context, tmpl templates.Partial) {
ctx.CompressWriter(true)
ctx.ContentType("text/html")
templates.WriteTemplate(ctx, tmpl)
}