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

saltandvinegarcrisps/router

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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());

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages