Yaf_Route_Simple::route
(Yaf >=1.0.0)
Route a request
Description
Route the request with query parameters: the module, controller and action names are retrieved from the query variables named as the ones given to the constructor.
Parameters
requestThe
Yaf_Request_Abstractinstance to route.
Return Values
Returns true if any of the three query variables is present, false otherwise, which makes the router try the next route.
Examples
Yaf_Route_Simple::route example
<?php
/* assume the request was made with
* http://yourdomain.com/index.php?m=main&c=product&a=detail */
$request = new Yaf_Request_Http("/index.php");
$route = new Yaf_Route_Simple("m", "c", "a");
var_dump($route->route($request));
var_dump($request->getModuleName());
var_dump($request->getControllerName());
var_dump($request->getActionName());
?>The above example will output something similar to:
bool(true)
string(4) "main"
string(7) "product"
string(6) "detail"See Also
Yaf_Route_Simple::__constructYaf_Route_Simple::assemble