1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-08 20:41:57 +00:00

builtin html template functions changes

This commit is contained in:
Gerasimos (Makis) Maropoulos
2022-12-13 01:37:15 +02:00
parent abeae40e60
commit 1ea5cd58be
115 changed files with 472 additions and 230 deletions

View File

@@ -113,7 +113,10 @@ func main() {
}
ctx.ViewData("title", "Show TODO")
ctx.View("todos/show.jet", todo)
if err := ctx.View("todos/show.jet", todo); err != nil {
ctx.HTML("<h3>%s</h3>", err.Error())
return
}
})
app.Get("/all-done", func(ctx iris.Context) {
// vars := make(view.JetRuntimeVars)
@@ -132,7 +135,10 @@ func main() {
// ctx.ViewData("_jet", (&doneTODOs{}).New(todos))
// and ctx.View("todos/index.jet")
// OR
ctx.View("todos/index.jet", (&doneTODOs{}).New(todos))
if err := ctx.View("todos/index.jet", (&doneTODOs{}).New(todos)); err != nil {
ctx.HTML("<h3>%s</h3>", err.Error())
return
}
})
port := os.Getenv("PORT")