1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-10 05:25:58 +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

@@ -22,5 +22,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
}
}

View File

@@ -3,6 +3,6 @@ html
head
title {{.Title}}
body
{{ yield }}
{{ yield . }}
footer
= include partials/footer.ace .

View File

@@ -21,5 +21,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
}
}

View File

@@ -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
}
}

View File

@@ -5,7 +5,7 @@
<body>
{{ template "content" . }}
<footer>
{{ partial "partials/footer" .}}
{{ partial "partials/footer" . }}
</footer>
</body>
</html>

View File

@@ -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
}
}

View File

@@ -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
}
}

View File

@@ -3,7 +3,7 @@
<title>{{Title}}</title>
</head>
<body>
{{ yield }}
{{ yield . }}
<footer>{{ render "partials/footer.html" .}}</footer>
</body>

View File

@@ -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
}
}

View File

@@ -3,9 +3,9 @@
<title>{{.Title}}</title>
</head>
<body>
{{ yield }}
{{ yield . }}
<footer>
{{ render "partials/footer.html" }}
{{ render "partials/footer.html" . }}
</footer>
</body>
</html>

View File

@@ -22,5 +22,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
}
}

View File

@@ -3,7 +3,7 @@
<title>{{.Title}}</title>
</head>
<body>
{{ yield documentBody() }}
{{ yield . documentBody() }}
<footer>{{ include "../partials/footer.jet" . }}</footer>
</body>
</html>

View File

@@ -21,5 +21,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
}
}