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

Method to get declared routes? #330

Open zkwbbr opened 1 year ago

zkwbbr commented 1 year ago

Is there a away to get all declared routes in the current version (or planned in the next)?

For example, something like this?

$router->get('/foo', Foo::class);
$router->get('/bar', Bar::class);

$result = $router->getRoutes(); // an array of the above (/foo and /bar)