mirror of
https://github.com/kataras/iris.git
synced 2026-01-06 03:27:27 +00:00
builtin html template functions changes
This commit is contained in:
@@ -20,5 +20,8 @@ func index(ctx iris.Context) {
|
||||
}
|
||||
|
||||
ctx.ViewLayout("layouts/main")
|
||||
ctx.View("index", data)
|
||||
if err := ctx.View("index", data); err != nil {
|
||||
ctx.HTML("<h3>%s</h3>", err.Error())
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,6 @@ html
|
||||
head
|
||||
title {{.Title}}
|
||||
body
|
||||
{{ yield }}
|
||||
{{ yield . . }}
|
||||
footer
|
||||
= include partials/footer.ace .
|
||||
|
||||
@@ -22,5 +22,8 @@ func index(ctx iris.Context) {
|
||||
// On Amber this is ignored: ctx.ViewLayout("layouts/main")
|
||||
// Layouts are only rendered from inside the index page itself
|
||||
// using the "extends" keyword.
|
||||
ctx.View("index", data)
|
||||
if err := ctx.View("index", data); err != nil {
|
||||
ctx.HTML("<h3>%s</h3>", err.Error())
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,5 +22,8 @@ func index(ctx iris.Context) {
|
||||
}
|
||||
|
||||
ctx.ViewLayout("main")
|
||||
ctx.View("index", data)
|
||||
if err := ctx.View("index", data); err != nil {
|
||||
ctx.HTML("<h3>%s</h3>", err.Error())
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
<!DOCTYPE html><html><head><title>{{.Title}}</title></head><body>{{ template "content" . }}<footer>{{ partial "partials/footer" .}}</footer></body></html>
|
||||
<!DOCTYPE html><html><head><title>{{.Title}}</title></head><body>{{ template "content" . }}<footer>{{ partial "partials/footer" . }}</footer></body></html>
|
||||
@@ -21,5 +21,8 @@ func index(ctx iris.Context) {
|
||||
// On Django this is ignored: ctx.ViewLayout("layouts/main")
|
||||
// Layouts are only rendered from inside the index page itself
|
||||
// using the "extends" keyword.
|
||||
ctx.View("index", data)
|
||||
if err := ctx.View("index", data); err != nil {
|
||||
ctx.HTML("<h3>%s</h3>", err.Error())
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,5 +19,8 @@ func index(ctx iris.Context) {
|
||||
}
|
||||
|
||||
ctx.ViewLayout("layouts/main")
|
||||
ctx.View("index", data)
|
||||
if err := ctx.View("index", data); err != nil {
|
||||
ctx.HTML("<h3>%s</h3>", err.Error())
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
<!DOCTYPE html><html><head><title>{{Title}}</title></head><body>{{ yield }}<footer>{{ render "partials/footer.html" .}}</footer></body></html>
|
||||
<!DOCTYPE html><html><head><title>{{Title}}</title></head><body>{{ yield . }}<footer>{{ render "partials/footer.html" .}}</footer></body></html>
|
||||
@@ -20,5 +20,8 @@ func index(ctx iris.Context) {
|
||||
}
|
||||
|
||||
ctx.ViewLayout("layouts/main")
|
||||
ctx.View("index", data)
|
||||
if err := ctx.View("index", data); err != nil {
|
||||
ctx.HTML("<h3>%s</h3>", err.Error())
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
<!DOCTYPE html><html><head><title>{{.Title}}</title></head><body>{{ yield }}<footer>{{ render "partials/footer.html" }}</footer></body></html>
|
||||
<!DOCTYPE html><html><head><title>{{.Title}}</title></head><body>{{ yield . }}<footer>{{ render "partials/footer.html" . }}</footer></body></html>
|
||||
@@ -21,5 +21,8 @@ func index(ctx iris.Context) {
|
||||
// On Jet this is ignored: ctx.ViewLayout("layouts/main")
|
||||
// Layouts are only rendered from inside the index page itself
|
||||
// using the "extends" keyword.
|
||||
ctx.View("index", data)
|
||||
if err := ctx.View("index", data); err != nil {
|
||||
ctx.HTML("<h3>%s</h3>", err.Error())
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,5 +22,8 @@ func index(ctx iris.Context) {
|
||||
// On Pug this is ignored: ctx.ViewLayout("layouts/main")
|
||||
// Layouts are only rendered from inside the index page itself
|
||||
// using the "extends" keyword.
|
||||
ctx.View("index", data)
|
||||
if err := ctx.View("index", data); err != nil {
|
||||
ctx.HTML("<h3>%s</h3>", err.Error())
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user