library siberian-wolf-router
Router class that match and generates routes
didozavar/siberian-wolf-router
Router class that match and generates routes
- Sunday, August 9, 2015
- by didozavar
- Repository
- 1 Watchers
- 0 Stars
- 7 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 1 Forks
- 0 Open issues
- 2 Versions
- 17 % Grown
siberian-wolf-router
, (*1)
Router library
Version: 0.6.0, (*2)
How to use it:, (*3)
$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');