MiddlewareApplication
in package
implements
HttpApplicationInterface
AbstractYes
Base class for standalone HTTP applications
Provides a base class to inherit from for applications using only the http package. This class defines a fallback handler that renders a simple 404 response.
You can overload the handle
method to provide your own logic
to run when no middleware generates a response.
Table of Contents
Interfaces
- HttpApplicationInterface
- An interface defining the methods that the http server depend on.
Methods
- bootstrap() : void
- Load all the application configuration and bootstrap logic.
- handle() : ResponseInterface
- Generate a 404 response as no middleware handled the request.
- middleware() : MiddlewareQueue
- Define the HTTP middleware layers for an application.
Methods
bootstrap()
Load all the application configuration and bootstrap logic.
public
abstract bootstrap() : void
Tags
handle()
Generate a 404 response as no middleware handled the request.
public
handle(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface
-
The request
Return values
ResponseInterfacemiddleware()
Define the HTTP middleware layers for an application.
public
abstract middleware(MiddlewareQueue $middlewareQueue) : MiddlewareQueue
Parameters
- $middlewareQueue : MiddlewareQueue
-
The middleware queue to set in your App Class