Class Middleware
Declares middleware names or inline closures that should be applied to matching routes.
String arguments reference registered middleware or middleware group names.
Closure arguments define inline middleware with the signature:
static function(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
Namespace: Cake\Routing\Attribute
Method Summary
-
__construct() public
Initializes a middleware attribute definition.
Method Detail
__construct() ¶ public
__construct(Closure|string ...$middleware)
Initializes a middleware attribute definition.
Parameters
-
Closure|string...$middleware Middleware names, group names, or inline closures.