thephpleague / route

Fast PSR-7 based routing and dispatch component including PSR-15 middleware, built on top of FastRoute.
http://route.thephpleague.com
MIT License
651 stars 126 forks source link

Feature request: map with array of methods #303

Closed ccerrillo closed 4 months ago

ccerrillo commented 3 years ago

I think it would be useful, allow using an array of methods, as it could be done before in 3.x version

zkwbbr commented 3 years ago

I like this feature too. Most of the time I have the same route for GET and POST. E.g.,

$router->get('register', Register::class);
$router->post('register', Register::class);

Would be nice if there's something like $router->map(['GET', 'POST'], 'register', Register::class);