Yaf_Route_Simple::__construct
(PECL 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 は、ルート情報をクエリ文字列から取得します。 コンストラクタのパラメータを使って、$_GET からルート情報を探します。
警告
この関数は、 現在のところ詳細な情報はありません。引数のリストのみが 記述されています。
パラメータ
-
module_name -
モジュールの情報を取得するキー。
-
controller_name -
コントローラの情報を取得するキー。
-
action_name -
アクションの情報を取得するキー。
返り値
常に 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() の例
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