(Yaf >=1.0.0)
Yaf_Router::getRoutes — Retrieve registered routes
This function has no parameters.
Example #1 Yaf_Router::getRoutes() example
<?php
class Bootstrap extends Yaf_Bootstrap_Abstract
{
public function _initRoutes(Yaf_Dispatcher $dispatcher)
{
$router = $dispatcher->getRouter();
$router->addRoute("rewrite", new Yaf_Route_Rewrite(
"/product/:id",
["controller" => "product", "action" => "detail"]
));
/* besides the custom one, the built-in "_default" route is
also part of the route table */
var_dump(array_keys($router->getRoutes()));
}
}
?>The above example will output something similar to:
array(2) {
[0]=>
string(8) "_default"
[1]=>
string(7) "rewrite"
}