Skip to content

PSR-Framework/router

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Router

Simple router for PSR-7 requests. PHP 7.4+

Latest Version Build Status Code Intelligence Status Quality Score Maintainability Total Downloads Monthly Downloads Software 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'));