From 7096050eda02d8962e94b4148ecb7bcfb09b5458 Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Wed, 5 Feb 2020 12:47:34 +0200 Subject: [PATCH] jet example: minor Former-commit-id: bbcb8d89e7f66465287f896d628679280ddddeba --- _examples/view/template_jet_2/main.go | 6 +++++- _examples/view/template_jet_2/views/page.jet | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/_examples/view/template_jet_2/main.go b/_examples/view/template_jet_2/main.go index 6363326a..3e9f8e44 100644 --- a/_examples/view/template_jet_2/main.go +++ b/_examples/view/template_jet_2/main.go @@ -23,7 +23,7 @@ func main() { mypath4Route.Name = "my-page4" // same with Handle/Func - mypath5Route := app.Handle("GET", "/mypath5/{paramfirst}/statichere/{paramsecond}/{otherparam}/anything/{something:path}", writePathHandler) + mypath5Route := app.Handle("GET", "/mypath5/{paramfirst:int}/statichere/{paramsecond}/{otherparam}/anything/{something:path}", writePathHandlerPage5) mypath5Route.Name = "my-page5" mypath6Route := app.Get("/mypath6/{paramfirst}/{paramsecond}/statichere/{paramThirdAfterStatic}", writePathHandler) @@ -64,3 +64,7 @@ func main() { func writePathHandler(ctx iris.Context) { ctx.Writef("Hello from %s.", ctx.Path()) } + +func writePathHandlerPage5(ctx iris.Context) { + ctx.Writef("Hello from %s.\nparamfirst(int)=%d", ctx.Path(), ctx.Params().GetIntDefault("paramfirst", 0)) +} diff --git a/_examples/view/template_jet_2/views/page.jet b/_examples/view/template_jet_2/views/page.jet index d0a0f220..c7268d9d 100644 --- a/_examples/view/template_jet_2/views/page.jet +++ b/_examples/view/template_jet_2/views/page.jet @@ -14,7 +14,7 @@

- + /mypath5/{paramfirst}/statichere/{paramsecond}/{otherparam}/anything/{anything:path}