PHP5.3+ Routing Class. Supports REST, dynamic and reversed routing.
View the Project on GitHub dannyvankooten/AltoRouter
Download ZIP View on GitHubTo use AltoRouter, you will need to rewrite all requests to a single file in which you create an instance of the AltoRouter class.
There are various ways to go about this, but here are examples for Apache and Nginx.
.htaccess
nginx.conf
All requests are now handled by the same file. In that file, you create an AltoRouter
instance.
Optionally, if your project lives in a sub-folder of your web root you use the setBasePath()
method to set a base path.
You are now ready to start mapping your routes.