PHP 클래스 CapMousse\ReactRestify\Routing\Router

상속: extends CapMousse\ReactRestify\Evenement\EventEmitter
파일 보기 프로젝트 열기: capmousse/react-restify 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$routes array The current routes list

공개 메소드들

메소드 설명
__construct ( array $routes = [] ) : Router Create a new routing element
addGroup ( String $prefix, $callback ) : CapMousse\ReactRestify\Routing\Group Create a new group of routes
addRoute ( String $method, String $route, Callable $callback ) Add a new route
addRoutes ( array $routes ) : Void Add routes
launch ( Request $request, CapMousse\ReactRestify\Http\Response $response, $next ) : Void Launch the route parsing

비공개 메소드들

메소드 설명
matchRoutes ( Request $request, CapMousse\ReactRestify\Http\Response $response, $next ) : Void Try to match the current uri with all routes

메소드 상세

__construct() 공개 메소드

Create a new routing element
public __construct ( array $routes = [] ) : Router
$routes array a route array
리턴 Router

addGroup() 공개 메소드

Create a new group of routes
public addGroup ( String $prefix, $callback ) : CapMousse\ReactRestify\Routing\Group
$prefix String prefix of thes routes
리턴 CapMousse\ReactRestify\Routing\Group

addRoute() 공개 메소드

Add a new route
public addRoute ( String $method, String $route, Callable $callback )
$method String type of route
$route String uri to catch
$callback Callable

addRoutes() 공개 메소드

Add routes
public addRoutes ( array $routes ) : Void
$routes array a route array
리턴 Void

launch() 공개 메소드

Launch the route parsing
public launch ( Request $request, CapMousse\ReactRestify\Http\Response $response, $next ) : Void
$request CapMousse\ReactRestify\Http\Request
$response CapMousse\ReactRestify\Http\Response
리턴 Void

프로퍼티 상세

$routes 공개적으로 프로퍼티

The current routes list
public array $routes
리턴 array