Yaf_Route_Simple::__construct

(Yaf >=1.0.0)

Yaf_Route_Simple::__constructYaf_Route_Simple constructor

說明

publicYaf_Route_Simple::__construct(string $module_name, string $controller_name, string $action_name)

Yaf_Route_Simple將從query string中獲得路由信息。這個(gè)構(gòu)造函數(shù)的參數(shù)會(huì)被作為鍵到$_GET中去尋找路由信息。

警告

本函數(shù)還未編寫文檔,僅有參數(shù)列表。

參數(shù)

module_name

module信息的鍵名。

controller_name

controller信息的鍵名。

action_name

action信息的鍵名。

返回值

總是返回TRUE

范例

示例 #1 Yaf_Route_Simple::route()example

<?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)

參見