(Yaf >=1.0.0)
Yaf_Route_Supervar::__construct — The __construct purpose
$supervar_name
)Yaf_Route_Supervar 类似于 Yaf_Route_Static,不同的是 Yaf_Route_Supervar 在 query 字符串中寻找路径信息,参数 supervar_name 是键。
supervar_name
键名
示例 #1 Yaf_Route_Supervar() 示例
<?php
/**
* Add a supervar route to Yaf_Router route stack
*/
Yaf_Dispatcher::getInstance()->getRouter()->addRoute(
"name",
new Yaf_Route_Supervar("r")
);
?>
以上示例的输出类似于:
/** for request: http://yourdomain.com/xx/oo/?r=/ctr/act/var/value * will result in following: */ array ( "module" => index(default), "controller" => ctr, "action" => act, "params" => array( "var" => value, ) )