PHP 클래스 flight\net\Router

파일 보기 프로젝트 열기: mikecao/flight 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$case_sensitive boolean Case sensitive matching.

보호된 프로퍼티들

프로퍼티 타입 설명
$index integer Pointer to current route.
$routes array Mapped routes.

공개 메소드들

메소드 설명
clear ( ) Clears all routes in the router.
current ( ) : Route Gets the current route.
getRoutes ( ) : array Gets mapped routes.
map ( string $pattern, callback $callback, boolean $pass_route = false ) Maps a URL pattern to a callback function.
next ( ) : Route Gets the next route.
reset ( ) Reset to the first route.
route ( flight\net\Request $request ) : Route | boolean Routes the current request.

메소드 상세

clear() 공개 메소드

Clears all routes in the router.
public clear ( )

current() 공개 메소드

Gets the current route.
public current ( ) : Route
리턴 Route

getRoutes() 공개 메소드

Gets mapped routes.
public getRoutes ( ) : array
리턴 array Array of routes

map() 공개 메소드

Maps a URL pattern to a callback function.
public map ( string $pattern, callback $callback, boolean $pass_route = false )
$pattern string URL pattern to match
$callback callback Callback function
$pass_route boolean Pass the matching route object to the callback

next() 공개 메소드

Gets the next route.
public next ( ) : Route
리턴 Route

reset() 공개 메소드

Reset to the first route.
public reset ( )

route() 공개 메소드

Routes the current request.
public route ( flight\net\Request $request ) : Route | boolean
$request flight\net\Request Request object
리턴 Route | boolean Matching route or false if no match

프로퍼티 상세

$case_sensitive 공개적으로 프로퍼티

Case sensitive matching.
public bool $case_sensitive
리턴 boolean

$index 보호되어 있는 프로퍼티

Pointer to current route.
protected int $index
리턴 integer

$routes 보호되어 있는 프로퍼티

Mapped routes.
protected array $routes
리턴 array