Download the PHP package delolmo/symfony-router without Composer
On this page you can find all versions of the php package delolmo/symfony-router. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download delolmo/symfony-router
More information about delolmo/symfony-router
Files in delolmo/symfony-router
Package symfony-router
Short Description PSR-15 middleware to use the symfony/routing component and store the route attributes in the request.
License MIT
Homepage https://github.com/delolmo/symfony-router
Informations about the package symfony-router
delolmo/symfony-router
PSR-15 middleware to use the symfony/routing component and store the route attributes in the request.
Requirements
- PHP ^8.1
- A PSR-7 http library
- A PSR-17 http factory
Installation
This package is installable and autoloadable via Composer as delolmo/symfony-router.
You may also want to install php-http/discovery to autodetect well-known PSR-17 HTTP factory implementations.
Example
Consider Symfony's PhpFileLoader to load route definitions from the following file:
For this example, we will be using middlewares/utils
for a PSR-15 compliant
dispatcher. See link
for more PSR-15 implementations.
This example uses a basic anonymous function to print the route's attributes:
Options
The constructor takes two arguments:
The router instance to use and a PSR-17 factory to create the error
responses (404
or 405
).
All versions of symfony-router with dependencies
php-http/discovery Version ^1.19
psr/http-message Version ^1.0 || ^2.0
psr/http-server-middleware Version ^1.0
symfony/config Version ^6.2
symfony/psr-http-message-bridge Version ^2.3
symfony/routing Version ^6.2