didozavar/siberian-wolf-router

Router class that match and generates routes

v0.6.0 2015-08-09 11:12 UTC

This package is not auto-updated.

Last update: 2025-07-06 00:28:42 UTC


README

Build Status

Router library Version: 0.6.0

How to use it:

$routes = [
            [
            'name' => 'home',
            'method' => 'get',
            'uri' => '/',
            'handler' => 'Home\Controller\IndexController@index'
            ]
];

$routes = new RouteCollection();

foreach($routes as $key => $value)
{
    $routes[$value['name']] = RouteFactory::create($value);
}

$router = new Router($routes);

//find or throw exception not found.
$router->match('home/test/user/12');