mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 18:51:03 +01:00
Updated render_templates (markdown)
parent
be95a9f5c5
commit
b26e2395be
|
@ -57,12 +57,12 @@ templateConfig := config.Template {
|
||||||
iris.Config().Render.Template = templateConfig
|
iris.Config().Render.Template = templateConfig
|
||||||
|
|
||||||
// 2. Fast way - Pongo snippet
|
// 2. Fast way - Pongo snippet
|
||||||
iris.Config().Render.Template.Engine = iris.PongoEngine
|
iris.Config().Render.Template.Engine = config.PongoEngine // or simple iris.PongoEngine
|
||||||
iris.Config().Render.Template.Directory = "mytemplates"
|
iris.Config().Render.Template.Directory = "mytemplates"
|
||||||
iris.Config().Render.Template.Pongo.Filters = ...
|
iris.Config().Render.Template.Pongo.Filters = ...
|
||||||
|
|
||||||
// 3. Fast way - HTMLTemplate snippet
|
// 3. Fast way - HTMLTemplate snippet
|
||||||
iris.Config().Render.Template.Engine = iris.HTMLTemplate // or iris.DefaultEngine
|
iris.Config().Render.Template.Engine = config.HTMLTemplate // or iris.DefaultEngine
|
||||||
iris.Config().Render.Template.Layout = "layout/layout.html" // = ./templates/layout/layout.html
|
iris.Config().Render.Template.Layout = "layout/layout.html" // = ./templates/layout/layout.html
|
||||||
//...
|
//...
|
||||||
|
|
||||||
|
@ -175,12 +175,11 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/kataras/iris"
|
"github.com/kataras/iris"
|
||||||
"github.com/kataras/iris/config"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
iris.Config().Render.Template.Engine = config.PongoEngine
|
iris.Config().Render.Template.Engine = iris.PongoEngine
|
||||||
|
|
||||||
iris.Get("/", func(ctx *iris.Context) {
|
iris.Get("/", func(ctx *iris.Context) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user