mirror of
https://github.com/kataras/iris.git
synced 2026-01-22 11:25:59 +00:00
builtin html template functions changes
This commit is contained in:
@@ -19,7 +19,10 @@ 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
|
||||
}
|
||||
}
|
||||
|
||||
func internalServerError(ctx iris.Context) {
|
||||
@@ -31,5 +34,8 @@ func internalServerError(ctx iris.Context) {
|
||||
}
|
||||
|
||||
ctx.ViewLayout("error")
|
||||
ctx.View("500", data)
|
||||
if err := ctx.View("500", data); err != nil {
|
||||
ctx.HTML("<h3>%s</h3>", err.Error())
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,6 @@
|
||||
<body>
|
||||
{{ template "content" . }}
|
||||
|
||||
<footer>{{ partial "partials/footer" .}}</footer>
|
||||
<footer>{{ partial "partials/footer" . }}</footer>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user