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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,6 @@ html
|
||||
head
|
||||
title {{.Title}}
|
||||
body
|
||||
{{ yield }}
|
||||
{{ yield . }}
|
||||
footer
|
||||
= include partials/footer.ace .
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<body>
|
||||
{{ template "content" . }}
|
||||
<footer>
|
||||
{{ partial "partials/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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,7 +3,7 @@
|
||||
<title>{{Title}}</title>
|
||||
</head>
|
||||
<body>
|
||||
{{ yield }}
|
||||
{{ yield . }}
|
||||
|
||||
<footer>{{ render "partials/footer.html" .}}</footer>
|
||||
</body>
|
||||
|
||||
@@ -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,9 +3,9 @@
|
||||
<title>{{.Title}}</title>
|
||||
</head>
|
||||
<body>
|
||||
{{ yield }}
|
||||
{{ yield . }}
|
||||
<footer>
|
||||
{{ render "partials/footer.html" }}
|
||||
{{ render "partials/footer.html" . }}
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<title>{{.Title}}</title>
|
||||
</head>
|
||||
<body>
|
||||
{{ yield documentBody() }}
|
||||
{{ yield . documentBody() }}
|
||||
<footer>{{ include "../partials/footer.jet" . }}</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user