(Yaf >=1.0.0)
Yaf_Route_Supervar::__construct — Construct a supervar route
Construct a supervar route. A supervar route expects a query variable to carry a PATH_INFO style URI.
supervar_nameThe name of the query variable that carries the URI.
No value is returned.
Example #1 Yaf_Route_Supervar::__construct() example
<?php
/**
* Add a supervar route to the Yaf_Router route stack.
*
* The URI is expected in the query variable named below,
* e.g. http://yourdomain.com/index.php?_url=/product/detail/id/10
*/
Yaf_Dispatcher::getInstance()->getRouter()->addRoute("supervar",
new Yaf_Route_Supervar("_url")
);
?>The above example will output something similar to:
/* http://yourdomain.com/index.php?_url=/product/detail/id/10 * routes to the following values: */ array( "controller" => "product", "module" => "index", //(default) "action" => "detail", //(default) ) /** * and request parameters: */ array( "id" => 10 )