PHP 클래스 Autarky\Routing\Router

상속: implements Autarky\Routing\RouterInterface
파일 보기 프로젝트 열기: autarky/framework 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$cachePath string | null
$currentHooks array The hooks that are currently applied to every route being added.
$currentPrefix string The URL prefix that is currently applied to every route being added.
$currentRoute Route
$dispatchData mixed
$eventDispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface
$hooks array
$invoker Autarky\Routing\InvokerInterface
$namedRoutes array
$routeCollector FastRoute\RouteCollector
$routeParser FastRoute\RouteParser
$routes SplObjectStorage

공개 메소드들

메소드 설명
__construct ( FastRoute\RouteParser $routeParser, Autarky\Routing\InvokerInterface $invoker, Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher = null, string | null $cachePath = null )
addAfterHook ( string $name, callable $handler, integer $priority ) : void Add an "after" event listener.
addBeforeHook ( string $name, callable $handler, integer $priority ) : void Add a "before" event listener.
addCachedRoute ( Route $route ) Add a cached route.
addGlobalAfterHook ( callable $handler, integer $priority ) : void Add a global "after" event listener.
addGlobalBeforeHook ( callable $handler, integer $priority ) : void Add a global "before" event listener.
addRoute ( $methods, $path, $controller, $name = null, array $options = [] )
dispatch ( Request $request )
getCurrentRoute ( )
getRoute ( $name )
getRouteForRequest ( Request $request ) : Route Get the Route object corresponding to a given request.
getRoutes ( ) : SplObjectStorage
group ( array $flags, Closure $callback )
isCaching ( ) : boolean
mount ( array $routes, $path = '/' )

보호된 메소드들

메소드 설명
addEventListener ( $name, $handler, $when, $priority )
addNamedRoute ( $name, Route $route )
createRoute ( $methods, $path, $controller, $name, array $options )
generateDispatchData ( )
getContainerParams ( Route $route, array $routeParams, Request $request )
getDispatcher ( )
getHook ( $name )
getResponse ( Request $request, Route $route, array $params )
makePath ( $path )
matchRoute ( Route $route, array $params, Request $request )

메소드 상세

__construct() 공개 메소드

public __construct ( FastRoute\RouteParser $routeParser, Autarky\Routing\InvokerInterface $invoker, Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher = null, string | null $cachePath = null )
$routeParser FastRoute\RouteParser
$invoker Autarky\Routing\InvokerInterface
$eventDispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface
$cachePath string | null

addAfterHook() 공개 메소드

Add an "after" event listener.
public addAfterHook ( string $name, callable $handler, integer $priority ) : void
$name string
$handler callable
$priority integer
리턴 void

addBeforeHook() 공개 메소드

Add a "before" event listener.
public addBeforeHook ( string $name, callable $handler, integer $priority ) : void
$name string
$handler callable
$priority integer
리턴 void

addCachedRoute() 공개 메소드

Add a cached route.
public addCachedRoute ( Route $route )
$route Route

addEventListener() 보호된 메소드

protected addEventListener ( $name, $handler, $when, $priority )

addGlobalAfterHook() 공개 메소드

Add a global "after" event listener.
public addGlobalAfterHook ( callable $handler, integer $priority ) : void
$handler callable
$priority integer
리턴 void

addGlobalBeforeHook() 공개 메소드

Add a global "before" event listener.
public addGlobalBeforeHook ( callable $handler, integer $priority ) : void
$handler callable
$priority integer
리턴 void

addNamedRoute() 보호된 메소드

protected addNamedRoute ( $name, Route $route )
$route Route

addRoute() 공개 메소드

public addRoute ( $methods, $path, $controller, $name = null, array $options = [] )
$options array

createRoute() 보호된 메소드

protected createRoute ( $methods, $path, $controller, $name, array $options )
$options array

dispatch() 공개 메소드

public dispatch ( Request $request )
$request Symfony\Component\HttpFoundation\Request

generateDispatchData() 보호된 메소드

protected generateDispatchData ( )

getContainerParams() 보호된 메소드

protected getContainerParams ( Route $route, array $routeParams, Request $request )
$route Route
$routeParams array
$request Symfony\Component\HttpFoundation\Request

getCurrentRoute() 공개 메소드

public getCurrentRoute ( )

getDispatcher() 보호된 메소드

protected getDispatcher ( )

getHook() 보호된 메소드

protected getHook ( $name )

getResponse() 보호된 메소드

protected getResponse ( Request $request, Route $route, array $params )
$request Symfony\Component\HttpFoundation\Request
$route Route
$params array

getRoute() 공개 메소드

public getRoute ( $name )

getRouteForRequest() 공개 메소드

Get the Route object corresponding to a given request.
public getRouteForRequest ( Request $request ) : Route
$request Symfony\Component\HttpFoundation\Request
리턴 Route

getRoutes() 공개 메소드

public getRoutes ( ) : SplObjectStorage
리턴 SplObjectStorage

group() 공개 메소드

public group ( array $flags, Closure $callback )
$flags array
$callback Closure

isCaching() 공개 메소드

public isCaching ( ) : boolean
리턴 boolean

makePath() 보호된 메소드

protected makePath ( $path )

matchRoute() 보호된 메소드

protected matchRoute ( Route $route, array $params, Request $request )
$route Route
$params array
$request Symfony\Component\HttpFoundation\Request

mount() 공개 메소드

public mount ( array $routes, $path = '/' )
$routes array

프로퍼티 상세

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

protected string|null $cachePath
리턴 string | null

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

The hooks that are currently applied to every route being added.
protected array $currentHooks
리턴 array

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

The URL prefix that is currently applied to every route being added.
protected string $currentPrefix
리턴 string

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

protected Route,Autarky\Routing $currentRoute
리턴 Route

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

protected mixed $dispatchData
리턴 mixed

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

protected EventDispatcherInterface,Symfony\Component\EventDispatcher $eventDispatcher
리턴 Symfony\Component\EventDispatcher\EventDispatcherInterface

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

protected array $hooks
리턴 array

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

protected InvokerInterface,Autarky\Routing $invoker
리턴 Autarky\Routing\InvokerInterface

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

protected array $namedRoutes
리턴 array

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

protected RouteCollector,FastRoute $routeCollector
리턴 FastRoute\RouteCollector

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

protected RouteParser,FastRoute $routeParser
리턴 FastRoute\RouteParser

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

protected SplObjectStorage $routes
리턴 SplObjectStorage