CakeFest 2024: The Official CakePHP Conference

Yaf_Route_Simple::__construct

(Yaf >=1.0.0)

Yaf_Route_Simple::__constructYaf_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()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)

参考

add a note

User Contributed Notes

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