PHP Класс Autarky\Routing\Router

Наследование: implements Autarky\Routing\RouterInterface
Показать файл Открыть проект Примеры использования класса

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

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