To install router as a Composer package run:
$ composer require darktec/router
First initialize the router
Router::init();
Then create your mappings using METHOD, ROUTE, ACTION where ACTION is a function
Router::map('GET', '/', '\package\controller@function');
// OR
Router::map('GET', '/', function() {
echo 1;
});
Finally match the request method and URI
Router::match($method, $uri);
If a match is found then the function defined is invoked.
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING and CONDUCT for details.
The MIT License (MIT). Please see License File for more information.