PHP Класс Orno\Route\RouteCollection

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

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

Свойство Тип Описание
$config Orno\Config\Repository | array
$container Orno\Di\ContainerInterface
$routes array

Открытые методы

Метод Описание
__construct ( Orno\Di\ContainerInterface $container = null, Orno\Config\Repository $config = null, FastRoute\RouteParser $parser = null, FastRoute\DataGenerator $generator = null ) Constructor
addRoute ( string $method, string $route, string | Closure $handler, integer $strategy = self::REQUEST_RESPONSE_STRATEGY ) : RouteCollection Add a route to the collection
delete ( string $route, string | Closure $handler, integer $strategy = self::REQUEST_RESPONSE_STRATEGY ) : RouteCollection Add a route that responds to DELETE HTTP method
get ( string $route, string | Closure $handler, integer $strategy = self::REQUEST_RESPONSE_STRATEGY ) : RouteCollection Add a route that responds to GET HTTP method
getDispatcher ( ) : Dispatcher Builds a dispatcher based on the routes attached to this collection
head ( string $route, string | Closure $handler, integer $strategy = self::REQUEST_RESPONSE_STRATEGY ) : RouteCollection Add a route that responds to HEAD HTTP method
options ( string $route, string | Closure $handler, integer $strategy = self::REQUEST_RESPONSE_STRATEGY ) : RouteCollection Add a route that responds to OPTIONS HTTP method
patch ( string $route, string | Closure $handler, integer $strategy = self::REQUEST_RESPONSE_STRATEGY ) : RouteCollection Add a route that responds to PATCH HTTP method
post ( string $route, string | Closure $handler, integer $strategy = self::REQUEST_RESPONSE_STRATEGY ) : RouteCollection Add a route that responds to POST HTTP method
put ( string $route, string | Closure $handler, integer $strategy = self::REQUEST_RESPONSE_STRATEGY ) : RouteCollection Add a route that responds to PUT HTTP method

Защищенные методы

Метод Описание
parseRouteString ( string $route ) : string Convenience method to convert pre-defined key words in to regex strings

Описание методов

__construct() публичный метод

Constructor
public __construct ( Orno\Di\ContainerInterface $container = null, Orno\Config\Repository $config = null, FastRoute\RouteParser $parser = null, FastRoute\DataGenerator $generator = null )
$container Orno\Di\ContainerInterface
$config Orno\Config\Repository
$parser FastRoute\RouteParser
$generator FastRoute\DataGenerator

addRoute() публичный метод

Add a route to the collection
public addRoute ( string $method, string $route, string | Closure $handler, integer $strategy = self::REQUEST_RESPONSE_STRATEGY ) : RouteCollection
$method string
$route string
$handler string | Closure
$strategy integer
Результат RouteCollection

delete() публичный метод

Add a route that responds to DELETE HTTP method
public delete ( string $route, string | Closure $handler, integer $strategy = self::REQUEST_RESPONSE_STRATEGY ) : RouteCollection
$route string
$handler string | Closure
$strategy integer
Результат RouteCollection

get() публичный метод

Add a route that responds to GET HTTP method
public get ( string $route, string | Closure $handler, integer $strategy = self::REQUEST_RESPONSE_STRATEGY ) : RouteCollection
$route string
$handler string | Closure
$strategy integer
Результат RouteCollection

getDispatcher() публичный метод

Builds a dispatcher based on the routes attached to this collection
public getDispatcher ( ) : Dispatcher
Результат Dispatcher

head() публичный метод

Add a route that responds to HEAD HTTP method
public head ( string $route, string | Closure $handler, integer $strategy = self::REQUEST_RESPONSE_STRATEGY ) : RouteCollection
$route string
$handler string | Closure
$strategy integer
Результат RouteCollection

options() публичный метод

Add a route that responds to OPTIONS HTTP method
public options ( string $route, string | Closure $handler, integer $strategy = self::REQUEST_RESPONSE_STRATEGY ) : RouteCollection
$route string
$handler string | Closure
$strategy integer
Результат RouteCollection

parseRouteString() защищенный метод

Convenience method to convert pre-defined key words in to regex strings
protected parseRouteString ( string $route ) : string
$route string
Результат string

patch() публичный метод

Add a route that responds to PATCH HTTP method
public patch ( string $route, string | Closure $handler, integer $strategy = self::REQUEST_RESPONSE_STRATEGY ) : RouteCollection
$route string
$handler string | Closure
$strategy integer
Результат RouteCollection

post() публичный метод

Add a route that responds to POST HTTP method
public post ( string $route, string | Closure $handler, integer $strategy = self::REQUEST_RESPONSE_STRATEGY ) : RouteCollection
$route string
$handler string | Closure
$strategy integer
Результат RouteCollection

put() публичный метод

Add a route that responds to PUT HTTP method
public put ( string $route, string | Closure $handler, integer $strategy = self::REQUEST_RESPONSE_STRATEGY ) : RouteCollection
$route string
$handler string | Closure
$strategy integer
Результат RouteCollection

Описание свойств

$config защищенное свойство

protected Repository,Orno\Config|array $config
Результат Orno\Config\Repository | array

$container защищенное свойство

protected ContainerInterface,Orno\Di $container
Результат Orno\Di\ContainerInterface

$routes защищенное свойство

protected array $routes
Результат array