array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'yaf-route-supervar.construct.php', 1 => 'Yaf_Route_Supervar::__construct', ), 'up' => array ( 0 => 'class.yaf-route-supervar.php', 1 => 'Yaf_Route_Supervar', ), 'prev' => array ( 0 => 'yaf-route-supervar.assemble.php', 1 => 'Yaf_Route_Supervar::assemble', ), 'next' => array ( 0 => 'yaf-route-supervar.route.php', 1 => 'Yaf_Route_Supervar::route', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/yaf/yaf_route_supervar/construct.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(Yaf >=1.0.0)
Yaf_Route_Supervar::__construct — The __construct purpose
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, ) )