diff --git a/index.php b/index.php index 3a96496..6e6536d 100644 --- a/index.php +++ b/index.php @@ -38,6 +38,7 @@ function navi() {
  • thecasedoesnotmatter
  • 404 Test
  • 405 Test
  • +
  • known routes
  • '; } @@ -202,6 +203,17 @@ Route::methodNotAllowed(function($path, $method) { echo 'The requested path "'.$path.'" exists. But the request method "'.$method.'" is not allowed on this path!'; }); +// Return all known routes +Route::add('/known-routes', function() { + navi(); + $routes = Route::getAll(); + echo ''; +}); + // Run the Router with the given Basepath Route::run(BASEPATH); diff --git a/src/Steampixel/Route.php b/src/Steampixel/Route.php index 66cc661..1a00b9f 100644 --- a/src/Steampixel/Route.php +++ b/src/Steampixel/Route.php @@ -23,6 +23,10 @@ class Route { )); } + public static function getAll(){ + return self::$routes; + } + public static function pathNotFound($function) { self::$pathNotFound = $function; }