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:
@@ -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...)...)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user