An open API service indexing awesome lists of open source software.

https://github.com/matthiasmullie/router-old

Extract information from a URL and build urls from controller/action/slugs.
https://github.com/matthiasmullie/router-old

Last synced: about 2 months ago
JSON representation

Extract information from a URL and build urls from controller/action/slugs.

Awesome Lists containing this project

README

        

# Router

## Example usage

// init router
use MatthiasMullie\Router;
$router = new Router\Router(__DIR__.'/tests/example/routes.xml');

// parse url & get path
$route = $router->route($_SERVER['REQUEST_URI']);
$controller = $router->getController();
$action = $router->getAction();
include "/$controller/$action.php";

// build url
$url = $router->getUrl($controller, $action);
echo "Link";

## License
Router is [MIT](http://opensource.org/licenses/MIT) licensed.