Yaf_Route_Supervar::__construct

(Yaf >=1.0.0)

Yaf_Route_Supervar::__constructThe __construct purpose

说明

public Yaf_Route_Supervar::__construct(string $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,
     )
  )

参见

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top