Skip to content
This repository was archived by the owner on Mar 28, 2018. It is now read-only.

Latest commit

 

History

History
20 lines (15 loc) · 345 Bytes

readme.md

File metadata and controls

20 lines (15 loc) · 345 Bytes

Simple url matcher.

$routes = new Routing\RouteCollection([
	'/' => function() {
		echo 'Hi';
	},
]);

$routes->merge([
	'/:id' => function() use($router) {
		echo $router->getParams()['id'];
	},
]);

$router = new Routing\UriMatcher;

$uri = $_SERVER['REQUEST_URI'];
$route = $router->match($uri);

$route($router->getParams());