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