PHP Class flight\net\Router

Afficher le fichier Open project: mikecao/flight Class Usage Examples

Méthodes publiques

Свойство Type Description
$case_sensitive boolean Case sensitive matching.

Protected Properties

Свойство Type Description
$index integer Pointer to current route.
$routes array Mapped routes.

Méthodes publiques

Méthode Description
clear ( ) Clears all routes in the router.
current ( ) : Route Gets the current route.
getRoutes ( ) : array Gets mapped routes.
map ( string $pattern, callback $callback, boolean $pass_route = false ) Maps a URL pattern to a callback function.
next ( ) : Route Gets the next route.
reset ( ) Reset to the first route.
route ( flight\net\Request $request ) : Route | boolean Routes the current request.

Method Details

clear() public méthode

Clears all routes in the router.
public clear ( )

current() public méthode

Gets the current route.
public current ( ) : Route
Résultat Route

getRoutes() public méthode

Gets mapped routes.
public getRoutes ( ) : array
Résultat array Array of routes

map() public méthode

Maps a URL pattern to a callback function.
public map ( string $pattern, callback $callback, boolean $pass_route = false )
$pattern string URL pattern to match
$callback callback Callback function
$pass_route boolean Pass the matching route object to the callback

next() public méthode

Gets the next route.
public next ( ) : Route
Résultat Route

reset() public méthode

Reset to the first route.
public reset ( )

route() public méthode

Routes the current request.
public route ( flight\net\Request $request ) : Route | boolean
$request flight\net\Request Request object
Résultat Route | boolean Matching route or false if no match

Property Details

$case_sensitive public_oe property

Case sensitive matching.
public bool $case_sensitive
Résultat boolean

$index protected_oe property

Pointer to current route.
protected int $index
Résultat integer

$routes protected_oe property

Mapped routes.
protected array $routes
Résultat array