PHP Class CapMousse\ReactRestify\Routing\Router

Inheritance: extends CapMousse\ReactRestify\Evenement\EventEmitter
Afficher le fichier Open project: capmousse/react-restify Class Usage Examples

Méthodes publiques

Свойство Type Description
$routes array The current routes list

Méthodes publiques

Méthode Description
__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

Private Methods

Méthode Description
matchRoutes ( Request $request, CapMousse\ReactRestify\Http\Response $response, $next ) : Void Try to match the current uri with all routes

Method Details

__construct() public méthode

Create a new routing element
public __construct ( array $routes = [] ) : Router
$routes array a route array
Résultat Router

addGroup() public méthode

Create a new group of routes
public addGroup ( String $prefix, $callback ) : CapMousse\ReactRestify\Routing\Group
$prefix String prefix of thes routes
Résultat CapMousse\ReactRestify\Routing\Group

addRoute() public méthode

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() public méthode

Add routes
public addRoutes ( array $routes ) : Void
$routes array a route array
Résultat Void

launch() public méthode

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
Résultat Void

Property Details

$routes public_oe property

The current routes list
public array $routes
Résultat array