1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-21 11:57:02 +00:00

add example for: #1614

This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-09-03 13:39:42 +03:00
parent dcd8fc4daa
commit d617a77209
5 changed files with 15 additions and 4 deletions

View File

@@ -2,6 +2,7 @@ package main
import (
"fmt"
"html/template"
"github.com/kataras/iris/v12"
)
@@ -78,6 +79,9 @@ func newApp() *iris.Application {
app.Get("/templates", func(ctx iris.Context) {
ctx.View("index.html", iris.Map{
"tr": ctx.Tr, // word, arguments... {call .tr "hi" "iris"}}
"trUnsafe": func(message string, args ...interface{}) template.HTML {
return template.HTML(ctx.Tr(message, args...))
},
})
// Note that,