PHP Класс CapMousse\ReactRestify\Routing\Router

Наследование: extends CapMousse\ReactRestify\Evenement\EventEmitter
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$routes array The current routes list

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

Метод Описание
__construct ( array $routes = [] ) : Router Create a new routing element
addGroup ( String $prefix, $callback ) : CapMousse\ReactRestify\Routing\Group Create a new group of routes
addRoute ( String $method, String $route, Callable $callback ) Add a new route
addRoutes ( array $routes ) : Void Add routes
launch ( Request $request, CapMousse\ReactRestify\Http\Response $response, $next ) : Void Launch the route parsing

Приватные методы

Метод Описание
matchRoutes ( Request $request, CapMousse\ReactRestify\Http\Response $response, $next ) : Void Try to match the current uri with all routes

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

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

Create a new routing element
public __construct ( array $routes = [] ) : Router
$routes array a route array
Результат Router

addGroup() публичный Метод

Create a new group of routes
public addGroup ( String $prefix, $callback ) : CapMousse\ReactRestify\Routing\Group
$prefix String prefix of thes routes
Результат CapMousse\ReactRestify\Routing\Group

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

Add a new route
public addRoute ( String $method, String $route, Callable $callback )
$method String type of route
$route String uri to catch
$callback Callable

addRoutes() публичный Метод

Add routes
public addRoutes ( array $routes ) : Void
$routes array a route array
Результат Void

launch() публичный Метод

Launch the route parsing
public launch ( Request $request, CapMousse\ReactRestify\Http\Response $response, $next ) : Void
$request CapMousse\ReactRestify\Http\Request
$response CapMousse\ReactRestify\Http\Response
Результат Void

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

$routes публичное свойство

The current routes list
public array $routes
Результат array