|
| addRoute (Route $route) |
|
| addRoutes (array $routes) |
|
| getRoutes () |
|
| parseRoute ($route, $method='GET') |
|
| get (string $pattern, $controller, array $rules=[], array $defaults=[]) |
|
| post (string $pattern, $controller, array $rules=[], array $defaults=[]) |
|
| put (string $pattern, $controller, array $rules=[], array $defaults=[]) |
|
| delete (string $pattern, $controller, array $rules=[], array $defaults=[]) |
|
| head (string $pattern, $controller, array $rules=[], array $defaults=[]) |
|
| options (string $pattern, $controller, array $rules=[], array $defaults=[]) |
|
| trace (string $pattern, $controller, array $rules=[], array $defaults=[]) |
|
| patch (string $pattern, $controller, array $rules=[], array $defaults=[]) |
|
| all (string $pattern, $controller, array $rules=[], array $defaults=[]) |
|
Interface defining a HTTP path router.
- Depuis
- 2.0.0
◆ addRoute()
Add a route to the router.
- Paramètres
-
Route | $route | The route definition |
- Renvoie
- $this
- Depuis
- 2.0.0
Implémenté dans Router.
◆ addRoutes()
addRoutes |
( |
array |
$routes | ) |
|
Add an array of route maps or objects to the router.
- Paramètres
-
Route[]|array[] | $routes A list of route maps or Route objects to add to the router. |
- Renvoie
- $this
- Depuis
- 2.0.0
- Exceptions
-
Implémenté dans Router.
◆ all()
all |
( |
string |
$pattern, |
|
|
|
$controller, |
|
|
array |
$rules = [] , |
|
|
array |
$defaults = [] |
|
) |
| |
Add a route to the router that accepts all request methods.
- Paramètres
-
string | $pattern | The route pattern to use for matching. |
mixed | $controller | The controller to map to the given pattern. |
array | $rules | An array of regex rules keyed using the route variables. |
array | $defaults | An array of default values that are used when the URL is matched. |
- Renvoie
- $this
- Depuis
- 2.0.0
Implémenté dans Router.
◆ delete()
delete |
( |
string |
$pattern, |
|
|
|
$controller, |
|
|
array |
$rules = [] , |
|
|
array |
$defaults = [] |
|
) |
| |
Add a DELETE route to the router.
- Paramètres
-
string | $pattern | The route pattern to use for matching. |
mixed | $controller | The controller to map to the given pattern. |
array | $rules | An array of regex rules keyed using the route variables. |
array | $defaults | An array of default values that are used when the URL is matched. |
- Renvoie
- $this
- Depuis
- 2.0.0
Implémenté dans Router.
◆ get()
get |
( |
string |
$pattern, |
|
|
|
$controller, |
|
|
array |
$rules = [] , |
|
|
array |
$defaults = [] |
|
) |
| |
Add a GET route to the router.
- Paramètres
-
string | $pattern | The route pattern to use for matching. |
mixed | $controller | The controller to map to the given pattern. |
array | $rules | An array of regex rules keyed using the route variables. |
array | $defaults | An array of default values that are used when the URL is matched. |
- Renvoie
- $this
- Depuis
- 2.0.0
Implémenté dans Router.
◆ getRoutes()
Get the routes registered with this router.
- Renvoie
- Route[]
- Depuis
- 2.0.0
Implémenté dans Router.
◆ head()
head |
( |
string |
$pattern, |
|
|
|
$controller, |
|
|
array |
$rules = [] , |
|
|
array |
$defaults = [] |
|
) |
| |
Add a HEAD route to the router.
- Paramètres
-
string | $pattern | The route pattern to use for matching. |
mixed | $controller | The controller to map to the given pattern. |
array | $rules | An array of regex rules keyed using the route variables. |
array | $defaults | An array of default values that are used when the URL is matched. |
- Renvoie
- $this
- Depuis
- 2.0.0
Implémenté dans Router.
◆ options()
options |
( |
string |
$pattern, |
|
|
|
$controller, |
|
|
array |
$rules = [] , |
|
|
array |
$defaults = [] |
|
) |
| |
Add a OPTIONS route to the router.
- Paramètres
-
string | $pattern | The route pattern to use for matching. |
mixed | $controller | The controller to map to the given pattern. |
array | $rules | An array of regex rules keyed using the route variables. |
array | $defaults | An array of default values that are used when the URL is matched. |
- Renvoie
- $this
- Depuis
- 2.0.0
Implémenté dans Router.
◆ parseRoute()
parseRoute |
( |
|
$route, |
|
|
|
$method = 'GET' |
|
) |
| |
Parse the given route and return the information about the route, including the controller assigned to the route.
- Paramètres
-
string | $route | The route string for which to find and execute a controller. |
string | $method | Request method to match, should be a valid HTTP request method. |
- Renvoie
- ResolvedRoute
- Depuis
- 2.0.0
- Exceptions
-
Implémenté dans Router.
◆ patch()
patch |
( |
string |
$pattern, |
|
|
|
$controller, |
|
|
array |
$rules = [] , |
|
|
array |
$defaults = [] |
|
) |
| |
Add a PATCH route to the router.
- Paramètres
-
string | $pattern | The route pattern to use for matching. |
mixed | $controller | The controller to map to the given pattern. |
array | $rules | An array of regex rules keyed using the route variables. |
array | $defaults | An array of default values that are used when the URL is matched. |
- Renvoie
- $this
- Depuis
- 2.0.0
Implémenté dans Router.
◆ post()
post |
( |
string |
$pattern, |
|
|
|
$controller, |
|
|
array |
$rules = [] , |
|
|
array |
$defaults = [] |
|
) |
| |
Add a POST route to the router.
- Paramètres
-
string | $pattern | The route pattern to use for matching. |
mixed | $controller | The controller to map to the given pattern. |
array | $rules | An array of regex rules keyed using the route variables. |
array | $defaults | An array of default values that are used when the URL is matched. |
- Renvoie
- $this
- Depuis
- 2.0.0
Implémenté dans Router.
◆ put()
put |
( |
string |
$pattern, |
|
|
|
$controller, |
|
|
array |
$rules = [] , |
|
|
array |
$defaults = [] |
|
) |
| |
Add a PUT route to the router.
- Paramètres
-
string | $pattern | The route pattern to use for matching. |
mixed | $controller | The controller to map to the given pattern. |
array | $rules | An array of regex rules keyed using the route variables. |
array | $defaults | An array of default values that are used when the URL is matched. |
- Renvoie
- $this
- Depuis
- 2.0.0
Implémenté dans Router.
◆ trace()
trace |
( |
string |
$pattern, |
|
|
|
$controller, |
|
|
array |
$rules = [] , |
|
|
array |
$defaults = [] |
|
) |
| |
Add a TRACE route to the router.
- Paramètres
-
string | $pattern | The route pattern to use for matching. |
mixed | $controller | The controller to map to the given pattern. |
array | $rules | An array of regex rules keyed using the route variables. |
array | $defaults | An array of default values that are used when the URL is matched. |
- Renvoie
- $this
- Depuis
- 2.0.0
Implémenté dans Router.
La documentation de cette interface a été générée à partir du fichier suivant :