mirror of
https://github.com/kataras/iris.git
synced 2025-12-17 18:07:01 +00:00
builtin html template functions changes
This commit is contained in:
@@ -35,10 +35,16 @@ func main() {
|
||||
my := app.Party("/my").Layout("layouts/mylayout.html")
|
||||
{ // both of these will use the layouts/mylayout.html as their layout.
|
||||
my.Get("/", func(ctx iris.Context) {
|
||||
ctx.View("page1.html")
|
||||
if err := ctx.View("page1.html"); err != nil {
|
||||
ctx.HTML("<h3>%s</h3>", err.Error())
|
||||
return
|
||||
}
|
||||
})
|
||||
my.Get("/other", func(ctx iris.Context) {
|
||||
ctx.View("page1.html")
|
||||
if err := ctx.View("page1.html"); err != nil {
|
||||
ctx.HTML("<h3>%s</h3>", err.Error())
|
||||
return
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user