PHP Class Orno\Route\Dispatcher

Inheritance: extends FastRoute\Dispatcher\GroupCountBased, implements Orno\Route\RouteStrategyInterface, use trait Orno\Route\RouteStrategyTrait
Afficher le fichier Open project: orno/route Class Usage Examples

Protected Properties

Свойство Type Description
$container Orno\Di\ContainerInterface
$routes array

Méthodes publiques

Méthode Description
__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

Méthodes protégées

Méthode Description
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

Method Details

__construct() public méthode

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

determineResponse() protected méthode

Attempt to build a response
protected determineResponse ( mixed $response ) : Orno\Http\ResponseInterface
$response mixed
Résultat Orno\Http\ResponseInterface

dispatch() public méthode

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
Résultat Orno\Http\ResponseInterface

handleFound() protected méthode

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
Résultat Orno\Http\ResponseInterface

handleMethodArgumentStrategy() protected méthode

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

handleNotAllowed() protected méthode

Handles a not allowed route
protected handleNotAllowed ( array $allowed ) : Orno\Http\ResponseInterface
$allowed array
Résultat Orno\Http\ResponseInterface

handleNotFound() protected méthode

Handle a not found route
protected handleNotFound ( ) : Orno\Http\ResponseInterface
Résultat Orno\Http\ResponseInterface

handleRequestResponseStrategy() protected méthode

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
Résultat Orno\Http\ResponseInterface

handleRestfulStrategy() protected méthode

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

handleUriStrategy() protected méthode

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

invokeController() public méthode

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

Property Details

$container protected_oe property

protected ContainerInterface,Orno\Di $container
Résultat Orno\Di\ContainerInterface

$routes protected_oe property

protected array $routes
Résultat array