https://github.com/psr-framework/router
Simple router for PHP 7.4+
https://github.com/psr-framework/router
framework php php7 router
Last synced: 11 months ago
JSON representation
Simple router for PHP 7.4+
- Host: GitHub
- URL: https://github.com/psr-framework/router
- Owner: PSR-Framework
- Archived: true
- Created: 2020-07-10T17:20:52.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-22T15:22:44.000Z (over 5 years ago)
- Last Synced: 2025-03-04T08:31:19.293Z (about 1 year ago)
- Topics: framework, php, php7, router
- Language: PHP
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Router
Simple router for PSR-7 requests. PHP 7.4+
[](https://github.com/Arslanoov/furious-router/releases)
[](https://scrutinizer-ci.com/g/Furious-PHP/router/build-status/master)
[](https://scrutinizer-ci.com/code-intelligence)
[](https://scrutinizer-ci.com/g/Furious-PHP/router)
[](https://codeclimate.com/github/Furious-PHP/router/maintainability)
[](https://packagist.org/packages/furious/router)
[](https://packagist.org/packages/furious/router)
[](LICENSE)
Install:
composer require furious/router
Use:
$routes = new RouteCollection();
// Add route
$routes->get('home', '/path', SomeHandler::class);
$router = new Router($routes);
// '/path'
$router->generate('home');
// Match route
$router->match($psr7Request);
// Add route in router
$router->addRoute(new Route('about', '/about', AboutHandler::class, 'GET'));