conia / route
PSR-7/PSR-15 router and dispatcher
dev-main
2024-01-28 11:08 UTC
Requires
- php: >=8.3
- conia/wire: ^0.3.0
- 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)
- conia/development: ^1.0
- dealerdirect/phpcodesniffer-composer-installer: ^1.0
- laminas/laminas-diactoros: ^3.3
- phpunit/phpunit: ^10.4
- vimeo/psalm: ^5.15
This package is auto-updated.
Last update: 2024-12-17 17:41:19 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);