AltoRouter

PHP5.3+ Routing Class. Supports REST, dynamic and reversed routing.

View the Project on GitHub dannyvankooten/AltoRouter

Download ZIP View on GitHub

AltoRouter

AltoRouter is a small but powerful routing class for PHP 5.3+, heavily inspired by klein.php.

$router = new AltoRouter();

// map homepage
$router->map( 'GET', '/', function() {
    require __DIR__ . '/views/home.php';
});

// map users details page
$router->map( 'GET|POST', '/users/[i:id]/', function( $id ) {
  $user = .....
  require __DIR__ . '/views/user/details.php';
});

Router Features

Using AltoRouter

To use AltoRouter in your project you need a web server running PHP 5.3 or newer.

Contributors

Released under the MIT Public License.

© 2012-2023 Danny van Kooten