Accepts either a Router\Route instance, or a combination of a path and
middleware, and optionally the HTTP methods allowed.
On first invocation, pipes the route middleware to the middleware
pipeline.
public route ( string | Zend\Expressive\Router\Route $path, callable | string | array $middleware = null, array $methods = null, null | string $name = null ) : Zend\Expressive\Router\Route | ||
$path | string | Zend\Expressive\Router\Route | |
$middleware | callable | string | array | Middleware (or middleware service name) to associate with route. |
$methods | array | HTTP method to accept; null indicates any. |
$name | null | string | the name of the route |
Résultat | Zend\Expressive\Router\Route |