Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Middleware to create responses with error status code (4xx-5xx)

License

NotificationsYou must be signed in to change notification settings

middlewares/error-response

Repository files navigation

Latest Version on PackagistSoftware LicenseTestingTotal Downloads

Middleware to format responses with HTTP error codes (4xx-5xx). Useful to create pretty 404 or 500 error pages.

Requirements

Installation

This package is installable and autoloadable via Composer asmiddlewares/error-response.

composer require middlewares/error-response

Example

useMiddlewares\ErrorResponse;Dispatcher::run([newMiddlewares\ErrorResponse()]);

Usage

The constructor accepts an array of responders, that must implement theMiddlewares\ErrorResponder\ResponderInterface.This package includes two basic responders: for html and json responses, that are enabled by default if no responders are passed.

//The default responders (for html and js)$responder =newMiddlewares\ErrorResponse();//Use your custom responders$responder =newMiddlewares\ErrorResponse([newMyHtmlResponder(),newMyJsonResponder()]);

Please seeCHANGELOG for more information about recent changes andCONTRIBUTING for contributing details.

The MIT License (MIT). Please seeLICENSE for more information.

About

Middleware to create responses with error status code (4xx-5xx)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp