Created
December 17, 2015 08:04
-
-
Save nosoop/490b891b9492abbddf10 to your computer and use it in GitHub Desktop.
List routes in Slim 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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