Download the PHP package middlewares/aura-router without Composer
On this page you can find all versions of the php package middlewares/aura-router. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download middlewares/aura-router
More information about middlewares/aura-router
Files in middlewares/aura-router
Package aura-router
Short Description Middleware to use Aura.Router
License MIT
Homepage https://github.com/middlewares/aura-router
Informations about the package aura-router
middlewares/aura-router
Middleware to use Aura.Router and store the route handler in a request attribute.
Requirements
- PHP >= 7.2
- A PSR-7 http library
- A PSR-15 middleware dispatcher
Installation
This package is installable and autoloadable via Composer as middlewares/aura-router.
Example
In this example, we are using middleware/request-handler to execute the route handler:
Aura.Router allows to define anything as the router handler (a closure, callback, action object, controller class, etc). The middleware will store this handler in a request attribute.
Usage
Create the middleware with a Aura\Router\RouterContainer
instance:
Optionally, you can provide a Psr\Http\Message\ResponseFactoryInterface
as the second argument, that will be used to create the error responses (404
, 405
or 406
). If it's not defined, Middleware\Utils\Factory will be used to detect it automatically.
attribute
The name of the server request attribute used to save the handler. The default value is request-handler
.
Please see CONTRIBUTING for contributing details.
The MIT License (MIT). Please see LICENSE for more information.
All versions of aura-router with dependencies
aura/router Version ^3.0
middlewares/utils Version ^3.0
psr/http-server-middleware Version ^1.0