Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de l'interface RouterInterface
+ Graphe d'héritage de RouterInterface:

Fonctions membres publiques

 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=[])
 

Description détaillée

Interface defining a HTTP path router.

Depuis
2.0.0

Documentation des fonctions membres

◆ addRoute()

addRoute ( Route  $route)

Add a route to the router.

Paramètres
Route$routeThe 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$patternThe route pattern to use for matching.
mixed$controllerThe controller to map to the given pattern.
array$rulesAn array of regex rules keyed using the route variables.
array$defaultsAn 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$patternThe route pattern to use for matching.
mixed$controllerThe controller to map to the given pattern.
array$rulesAn array of regex rules keyed using the route variables.
array$defaultsAn 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$patternThe route pattern to use for matching.
mixed$controllerThe controller to map to the given pattern.
array$rulesAn array of regex rules keyed using the route variables.
array$defaultsAn array of default values that are used when the URL is matched.
Renvoie
$this
Depuis
2.0.0

Implémenté dans Router.

◆ getRoutes()

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$patternThe route pattern to use for matching.
mixed$controllerThe controller to map to the given pattern.
array$rulesAn array of regex rules keyed using the route variables.
array$defaultsAn 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$patternThe route pattern to use for matching.
mixed$controllerThe controller to map to the given pattern.
array$rulesAn array of regex rules keyed using the route variables.
array$defaultsAn 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$routeThe route string for which to find and execute a controller.
string$methodRequest method to match, should be a valid HTTP request method.
Renvoie
ResolvedRoute
Depuis
2.0.0
Exceptions
Exception

Implémenté dans Router.

◆ patch()

patch ( string  $pattern,
  $controller,
array  $rules = [],
array  $defaults = [] 
)

Add a PATCH route to the router.

Paramètres
string$patternThe route pattern to use for matching.
mixed$controllerThe controller to map to the given pattern.
array$rulesAn array of regex rules keyed using the route variables.
array$defaultsAn 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$patternThe route pattern to use for matching.
mixed$controllerThe controller to map to the given pattern.
array$rulesAn array of regex rules keyed using the route variables.
array$defaultsAn 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$patternThe route pattern to use for matching.
mixed$controllerThe controller to map to the given pattern.
array$rulesAn array of regex rules keyed using the route variables.
array$defaultsAn 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$patternThe route pattern to use for matching.
mixed$controllerThe controller to map to the given pattern.
array$rulesAn array of regex rules keyed using the route variables.
array$defaultsAn 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 :