- Easy to use
- Supports GET, POST, PUT, PATCH, DELETE & OPTIONS verbs
- Supports Route Parameters (Regex support)
- Middleware
- Route Groups
- Reverse Routing (Generate URL from Route Name)
- Subdirectory Routing
- Error Routes
- Implement Custom Resolver & Dispatcher
composer require adrianschubek/router
use adrianschubek\Routing\Route;
use adrianschubek\Routing\Router;
$r = new Router();
$r->get("/", function () {
echo "Hello stranger!";
});
$r->get("/[a]/[b]", function ($a, $b) {
echo $a + $b;
})->where("([0-9]+)");
$r->dispatch();