Yaf_Route_Simple::route
Route a request
Description
public bool Yaf_Route_Simple::route(Yaf_Request_Abstract $request)
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
-
request
-
The Yaf_Request_Abstract instance 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
Example #1 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::__construct
- Yaf_Route_Simple::assemble