Yaf_Route_Simple::__construct
(Yaf >=1.0.0)
Yaf_Route_Simple::__construct — Yaf_Route_Simple 构造方法
说明
public Yaf_Route_Simple::__construct(string
$module_name
, string $controller_name
, string $action_name
)Yaf_Route_Simple 将从 query 字符串中获得路由信息。这个构造方法的参数会被作为键到 $_GET 中去寻找路由信息。
警告
本函数还未编写文档,仅有参数列表。
参数
module_name
-
module 信息的键名。
controller_name
-
controller 信息的键名。
action_name
-
action 信息的键名。
返回值
总是返回 true
。
示例
示例 #1 Yaf_Route_Simple::route() 示例
<?php
$route = new Yaf_Route_Simple("m", "controller", "act");
Yaf_Router::getInstance()->addRoute("simple", $route);
?>
示例 #2 Yaf_Route_Simple::route()example
Request: http://yourdomain.com/path/?controller=a&act=b => module = default(index), controller = a, action = b Request: http://yourdomain.com/path => module = default(index), controller = default(index), action = default(index)
参见
- Yaf_Route_Supervar::route() - The route purpose
- Yaf_Route_Static::route() - 路由请求
- Yaf_Route_Regex::route() - The route purpose
- Yaf_Route_Rewrite::route() - The route purpose
- Yaf_Route_Map::route() - The route purpose
+添加备注
用户贡献的备注
此页面尚无用户贡献的备注。
备份地址:http://www.lvesu.com/blog/php/yaf-route-simple.construct.php