Skip to content

Instantly share code, notes, and snippets.

@nosoop
Created December 17, 2015 08:04
Show Gist options
  • Save nosoop/490b891b9492abbddf10 to your computer and use it in GitHub Desktop.
Save nosoop/490b891b9492abbddf10 to your computer and use it in GitHub Desktop.
List routes in Slim 3
class RouteDumper extends \Slim\Router {
public static function getAllRoutes($app) {
return $app->getContainer()->get('router')->routes;
}
}
// Pass instance of \Slim\App() to function
$routes = RouteDumper::getAllRoutes($app);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment