-
Notifications
You must be signed in to change notification settings - Fork 1
PSR 15: RequestHandler Example
Terry L edited this page Jun 20, 2020
·
5 revisions
Namespace
Shieldon\Psr15\RequestHandler
-
param
RequestHandlerInterface
fallbackHandler*
The request handler.
Example:
$finalHandler = new FinalHandler();
$app = new RequestHandler($finalHandler);
$app->add(new ApiMiddleware());
$app->add(new StringMiddleware());
$response = $app->handle(ServerRequestFactory::fromGlobal());
-
param
MiddlewareInterface
middleware*
The middleware. -
return
void
Example:
$app->add(new ApiMiddleware());
-
param
ServerRequestInterface
request*
The server request. -
return
ResponseInterface
Example:
$response = $app->handle(ServerRequestFactory::fromGlobal());
composer require shieldon/psr-http
Shieldon PSR HTTP implementation written by Terry L. from Taiwan.