2017 © Pedro Peláez
 

library router

A simple PHP router

image

iandenh/router

A simple PHP router

  • Thursday, October 16, 2014
  • by Iandenh
  • Repository
  • 2 Watchers
  • 5 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Iandenh Router

Router.php is a simple Router for PHP., (*1)

Example

<?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, (*2)

The Versions

16/10 2014

dev-master

9999999-dev https://github.com/Iandenh/Router

A simple PHP router

  Sources   Download

The Requires

  • php >=5.3.0

 

router

16/10 2014

dev-beta

dev-beta https://github.com/Iandenh/Router

A simple PHP router

  Sources   Download

The Requires

  • php >=5.3.0

 

router

07/01 2014

0.2

0.2.0.0 https://github.com/Iandenh/Router

A simple PHP router

  Sources   Download

The Requires

  • php >=5.3.0

 

router

07/12 2013

0.1

0.1.0.0 https://github.com/Iandenh/Router

A simple PHP router

  Sources   Download

The Requires

  • php >=5.3.0

 

router