Yet Another Framework 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은 쿼리 문자열에서 경로 정보를 가져옵니다. 그리고 이 생성자의 매개변수는 $_GET에서 경로 정보를 검색하는 동안 키로 사용됩니다.
경고 이 함수는 현재 문서화되어 있지 않습니다. 인수 목록만 사용할 수 있습니다.
매개변수
module_name
- 모듈 정보의 키 이름입니다.
controller_name
- 컨트롤러 정보의 키 이름입니다.
action_name
- 작업 정보의 키 이름입니다.
반환 값
항상 true
를 반환합니다.
Examples
예제 #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() - Route a request
- Yaf_Route_Regex::route() - The route purpose
- Yaf_Route_Rewrite::route() - The route purpose
- Yaf_Route_Map::route() - The route purpose