codeguy/Slim — pull request #514 by t1gr0u (2013-04-28 22:56:11+00:00)
Title: new feature on Router: list all defined routes with method

Hi,

we are using Slim on our RESTful APIs and one thing that we do is to list all our available routes, so who ever needs our API they know which routes are available.

$app->router->listRoutes();
This will return an array of routes:
array(
'GET::/foo',
'POST::/bar'
);

You can also change the separator or don't show the method
$app->router->listRoutes( '->' );
array(
'GET->/foo',
'POST->/bar'
);

$app->router->listRoutes( '::', false );
array(
'/foo',
'/bar'
);

Just thought that maybe someone else would be interested in this feature.

T1gr0u