mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 10:27:06 +00:00
8.4.0 | New MVC Features | Refactor examples and godoc for go 1.9 use. Read HISTORY.md.
Former-commit-id: 90c05e743052bc3722e7fefaa0cbb0ed5153a1fb
This commit is contained in:
@@ -2,7 +2,6 @@ package main
|
||||
|
||||
import (
|
||||
"github.com/kataras/iris"
|
||||
"github.com/kataras/iris/context"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -42,30 +41,30 @@ func main() {
|
||||
app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed))
|
||||
}
|
||||
|
||||
func h(ctx context.Context) {
|
||||
func h(ctx iris.Context) {
|
||||
param := ctx.Params().Get("p")
|
||||
ctx.WriteString(param)
|
||||
}
|
||||
|
||||
func staticWildcardH(ctx context.Context) {
|
||||
func staticWildcardH(ctx iris.Context) {
|
||||
param := ctx.Params().Get("p")
|
||||
ctx.WriteString("from staticWildcardH: param=" + param)
|
||||
}
|
||||
|
||||
func other(ctx context.Context) {
|
||||
func other(ctx iris.Context) {
|
||||
param := ctx.Params().Get("paramother")
|
||||
ctx.Writef("from other: %s", param)
|
||||
}
|
||||
|
||||
func other2(ctx context.Context) {
|
||||
func other2(ctx iris.Context) {
|
||||
param := ctx.Params().Get("paramothersecond")
|
||||
ctx.Writef("from other2: %s", param)
|
||||
}
|
||||
|
||||
func staticPath(ctx context.Context) {
|
||||
func staticPath(ctx iris.Context) {
|
||||
ctx.Writef("from the static path(/): %s", ctx.Path())
|
||||
}
|
||||
|
||||
func staticPathOther2(ctx context.Context) {
|
||||
func staticPathOther2(ctx iris.Context) {
|
||||
ctx.Writef("from the static path(/other2/static2): %s", ctx.Path())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user