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.
- Host: GitHub
- URL: https://github.com/matthiasmullie/router-old
- Owner: matthiasmullie
- Created: 2013-04-15T13:08:13.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2016-01-15T07:36:00.000Z (over 9 years ago)
- Last Synced: 2025-03-19T00:44:21.026Z (2 months ago)
- Language: PHP
- Size: 5.86 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.