(Yaf >=1.0.0)
Yaf_Router::getRoutes — Retrieve registered routes
У цієї функції немає параметрів.
Приклад #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()));
}
}
?>Поданий вище приклад виведе щось схоже на:
array(2) {
[0]=>
string(8) "_default"
[1]=>
string(7) "rewrite"
}