From 009f163c3dd4ff6d6181e24e8fc3b5596a4570cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20P=C3=B6ll?= Date: Fri, 19 Dec 2014 15:26:51 +0100 Subject: [PATCH] Update AltoRouter.php Added function getRoutes(). Often it's nice to process routes or display them without extending AltoRouter. --- AltoRouter.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/AltoRouter.php b/AltoRouter.php index 194a672..9c6c13a 100644 --- a/AltoRouter.php +++ b/AltoRouter.php @@ -26,7 +26,15 @@ class AltoRouter { $this->setBasePath($basePath); $this->addMatchTypes($matchTypes); } - + + /** + * Retrieves all routes. + * Useful if you want to process or display routes. + */ + public function getRoutes() { + return $this->routes; + } + /** * Add multiple routes at once from array in the following format: * @@ -46,7 +54,7 @@ class AltoRouter { call_user_func_array(array($this, 'map'), $route); } } - + /** * Set the base path. * Useful if you are running your application from a subdirectory.