This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (0.2) of this package.

A simple PHP router

0.2 2014-01-07 08:53 UTC


Router.php is a simple Router for PHP.


require_once 'src/Router/Router.php';
require_once 'src/Router/Route.php';

$router = new \Router\Router();

$router->add('GET','/', function(){
    echo 'index';
$router->add('/bar/*', function(){
    echo 'wildcard';
$router->add('/foo/:name', function($route){
    echo "Hallo, $route->name";
$router->add(new \Router\CaseInsensitiveRoute('/HaHa'), function($route){
    echo "Hallo, $route->name";
$router->route($_GET['q'], function(){
    echo 'error 404';

Ian den Hartog