1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-17 18:07:01 +00:00

Update to 8.3.2 | Read HISTORY.md file

Former-commit-id: e6ab761989d596cb004c39e65e04e8968d9461ab
This commit is contained in:
kataras
2017-08-22 13:00:24 +03:00
parent 33e651866e
commit e12513a534
12 changed files with 150 additions and 13 deletions

View File

@@ -492,15 +492,16 @@ func (api *APIBuilder) Any(relativePath string, handlers ...context.Handler) (ro
// }
//
// Usage: app.Controller("/user/{id:int}", new(UserController), db, time.Now())
// Note: Binded values of context.Handler type are being recognised as middlewares by the router.
//
// Read more at `/mvc#Controller`.
func (api *APIBuilder) Controller(relativePath string, controller activator.BaseController,
bindValues ...interface{}) (routes []*Route) {
registerFunc := func(method string, handler context.Handler) {
registerFunc := func(method string, handlers ...context.Handler) {
if method == "ANY" || method == "ALL" {
routes = api.Any(relativePath, handler)
routes = api.Any(relativePath, handlers...)
} else {
routes = append(routes, api.HandleMany(method, relativePath, handler)...)
routes = append(routes, api.HandleMany(method, relativePath, handlers...)...)
}
}