mirror of
https://github.com/dannyvankooten/AltoRouter.git
synced 2025-08-04 07:27:36 +02:00
Update AltoRouter.php
Added function getRoutes(). Often it's nice to process routes or display them without extending AltoRouter.
This commit is contained in:
@@ -26,7 +26,15 @@ class AltoRouter {
|
|||||||
$this->setBasePath($basePath);
|
$this->setBasePath($basePath);
|
||||||
$this->addMatchTypes($matchTypes);
|
$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:
|
* 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);
|
call_user_func_array(array($this, 'map'), $route);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the base path.
|
* Set the base path.
|
||||||
* Useful if you are running your application from a subdirectory.
|
* Useful if you are running your application from a subdirectory.
|
||||||
|
Reference in New Issue
Block a user