(Yaf >=1.0.0)
Yaf_Dispatcher::getRouter — Retrieve router instance
Retrieve the Yaf_Router instance used by the dispatcher to route requests.
Diese Funktion besitzt keine Parameter.
The Yaf_Router instance, or null if the
application is not initialized.
Beispiel #1 Yaf_Dispatcher::getRouter() example
<?php
class Bootstrap extends Yaf_Bootstrap_Abstract
{
public function _initRoute(Yaf_Dispatcher $dispatcher)
{
$router = $dispatcher->getRouter();
// Route /product/42 to ProductController::detailAction
$router->addRoute("product", new Yaf_Route_Rewrite(
"product/:id",
array("controller" => "product", "action" => "detail")
));
}
}
?>