mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 18:51:03 +01:00
jet example: minor
Former-commit-id: bbcb8d89e7f66465287f896d628679280ddddeba
This commit is contained in:
parent
9c97a8a668
commit
7096050eda
|
@ -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))
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<br />
|
||||
<br />
|
||||
|
||||
<a href="{{urlpath("my-page5", "theParam1", "theParam2Afterstatichere", "otherParam", "matchAnythingAfterStatic")}}">
|
||||
<a href="{{urlpath("my-page5", "42", "theParam2Afterstatichere", "otherParam", "matchAnythingAfterStatic")}}">
|
||||
/mypath5/{paramfirst}/statichere/{paramsecond}/{otherparam}/anything/{anything:path}</a>
|
||||
<br />
|
||||
<br />
|
||||
|
|
Loading…
Reference in New Issue
Block a user