Class MiddlewareApplication

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.

Abstract
Namespace: Cake\Http

Method Summary

  • bootstrap() abstract public

    Load all the application configuration and bootstrap logic.

  • handle() public

    Generate a 404 response as no middleware handled the request.

  • middleware() abstract public

    Define the HTTP middleware layers for an application.

Method Detail

bootstrap() abstract public

bootstrap()

Load all the application configuration and bootstrap logic.

Override this method to add additional bootstrap logic for your application.

handle() public

handle(\Psr\Http\Message\ServerRequestInterface $request)

Generate a 404 response as no middleware handled the request.

Parameters

\Psr\Http\Message\ServerRequestInterface $request

The request

Returns

\Psr\Http\Message\ResponseInterface

middleware() abstract public

middleware(\Cake\Http\MiddlewareQueue $middlewareQueue)

Define the HTTP middleware layers for an application.

Parameters

\Cake\Http\MiddlewareQueue $middlewareQueue

The middleware queue to set in your App Class

Returns

\Cake\Http\MiddlewareQueue

© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.0/class-Cake.Http.MiddlewareApplication.html