My older regex-based router.
Go to file
2017-10-25 08:25:13 +02:00
.htaccess Added more example rules and comments. 2015-09-10 14:09:42 +02:00
Config.php initial commit 2015-09-10 13:37:52 +02:00
index.php Added leading slash to routes 2017-10-25 08:25:13 +02:00
README.md Update README.md 2015-09-10 14:15:24 +02:00
Route.php Added leading slash to routes 2017-10-25 08:25:13 +02:00

This is a simple example that shows a simple PHP routing system. This is not for production use but for people who want to understand how such a system works. Take a look in the index.php file. You can use the Route::add method to add a new route to your project. The first argument takes the URL. You can use Regexp in there to parse variables directly out of the URL und push them to the handler method. The handler is the second argument of the add method. Dont forget to set the basepath in index.php and .htaccess file.