duon / router
PSR-7/PSR-15 router and dispatcher
dev-main
2025-04-01 17:14 UTC
Requires
- php: >=8.3
- duon/wire: dev-main
- psr/container: ^2.0
- psr/http-message: ^1.1 || ^2.0
- psr/http-message-implementation: ^1.0
- psr/http-server-handler: ^1.0
- psr/http-server-middleware: ^1.0
Requires (Dev)
- dealerdirect/phpcodesniffer-composer-installer: ^1.0
- duon/dev: ^1.1
- laminas/laminas-diactoros: ^3.3
- phpunit/phpunit: ^12.0
- vimeo/psalm: ^6.10
This package is auto-updated.
Last update: 2025-04-01 17:18:02 UTC
README
A PSR-7 compatible router and view dispatcher.
<?php $router = new Router(); $router->get('/{name}', funtion (string $name) { return "<h1>{$name}</h1>"; }); $request = new ServerRequest(); $route = $router->match($request); $dispatcher = new Dispatcher(); $response = $dispatcher->dispatch($request, $route);