PHP 클래스 Orno\Route\RouteCollection

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

보호된 프로퍼티들

프로퍼티 타입 설명
$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