PHP Класс Orno\Route\Dispatcher

Наследование: extends FastRoute\Dispatcher\GroupCountBased, implements Orno\Route\RouteStrategyInterface, use trait Orno\Route\RouteStrategyTrait
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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