PHP 클래스 Orno\Route\Dispatcher

상속: extends FastRoute\Dispatcher\GroupCountBased, implements Orno\Route\RouteStrategyInterface, use trait Orno\Route\RouteStrategyTrait
파일 보기 프로젝트 열기: orno/route 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$container Orno\Di\ContainerInterface
$routes array

공개 메소드들

메소드 설명
__construct ( Orno\Di\ContainerInterface $container, array $routes, array $data ) Constructor
dispatch ( string $method, string $uri ) : Orno\Http\ResponseInterface Match and dispatch a route matching the given http method and uri
invokeController ( string | array | Closure $controller, array $vars = [] ) : Orno\Http\ResponseInterface Invoke a controller action

보호된 메소드들

메소드 설명
determineResponse ( mixed $response ) : Orno\Http\ResponseInterface Attempt to build a response
handleFound ( string | Closure $handler, integer | Orno\Route\CustomStrategyInterface $strategy, array $vars ) : Orno\Http\ResponseInterface Handle dispatching of a found route
handleMethodArgumentStrategy ( string | array | Closure $controller, array $vars ) : Orno\Http\ResponseInterface Handles response to Method Argument Strategy
handleNotAllowed ( array $allowed ) : Orno\Http\ResponseInterface Handles a not allowed route
handleNotFound ( ) : Orno\Http\ResponseInterface Handle a not found route
handleRequestResponseStrategy ( string | array | Closure $controller, array $vars = [] ) : Orno\Http\ResponseInterface Handles response to Request -> Response Strategy based routes
handleRestfulStrategy ( string | array | Closure $controller, array $vars = [] ) : Orno\Http\ResponseInterface Handles response to Restful Strategy based routes
handleUriStrategy ( string | array | Closure $controller, array $vars ) : Orno\Http\ResponseInterface Handles response to URI Strategy based routes

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( Orno\Di\ContainerInterface $container, array $routes, array $data )
$container Orno\Di\ContainerInterface
$routes array
$data array

determineResponse() 보호된 메소드

Attempt to build a response
protected determineResponse ( mixed $response ) : Orno\Http\ResponseInterface
$response mixed
리턴 Orno\Http\ResponseInterface

dispatch() 공개 메소드

Match and dispatch a route matching the given http method and uri
public dispatch ( string $method, string $uri ) : Orno\Http\ResponseInterface
$method string
$uri string
리턴 Orno\Http\ResponseInterface

handleFound() 보호된 메소드

Handle dispatching of a found route
protected handleFound ( string | Closure $handler, integer | Orno\Route\CustomStrategyInterface $strategy, array $vars ) : Orno\Http\ResponseInterface
$handler string | Closure
$strategy integer | Orno\Route\CustomStrategyInterface
$vars array
리턴 Orno\Http\ResponseInterface

handleMethodArgumentStrategy() 보호된 메소드

Handles response to Method Argument Strategy
protected handleMethodArgumentStrategy ( string | array | Closure $controller, array $vars ) : Orno\Http\ResponseInterface
$controller string | array | Closure
$vars array
리턴 Orno\Http\ResponseInterface

handleNotAllowed() 보호된 메소드

Handles a not allowed route
protected handleNotAllowed ( array $allowed ) : Orno\Http\ResponseInterface
$allowed array
리턴 Orno\Http\ResponseInterface

handleNotFound() 보호된 메소드

Handle a not found route
protected handleNotFound ( ) : Orno\Http\ResponseInterface
리턴 Orno\Http\ResponseInterface

handleRequestResponseStrategy() 보호된 메소드

Handles response to Request -> Response Strategy based routes
protected handleRequestResponseStrategy ( string | array | Closure $controller, array $vars = [] ) : Orno\Http\ResponseInterface
$controller string | array | Closure
$vars array
리턴 Orno\Http\ResponseInterface

handleRestfulStrategy() 보호된 메소드

Handles response to Restful Strategy based routes
protected handleRestfulStrategy ( string | array | Closure $controller, array $vars = [] ) : Orno\Http\ResponseInterface
$controller string | array | Closure
$vars array
리턴 Orno\Http\ResponseInterface

handleUriStrategy() 보호된 메소드

Handles response to URI Strategy based routes
protected handleUriStrategy ( string | array | Closure $controller, array $vars ) : Orno\Http\ResponseInterface
$controller string | array | Closure
$vars array
리턴 Orno\Http\ResponseInterface

invokeController() 공개 메소드

Invoke a controller action
public invokeController ( string | array | Closure $controller, array $vars = [] ) : Orno\Http\ResponseInterface
$controller string | array | Closure
$vars array
리턴 Orno\Http\ResponseInterface

프로퍼티 상세

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

protected ContainerInterface,Orno\Di $container
리턴 Orno\Di\ContainerInterface

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

protected array $routes
리턴 array