ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
FastRoute\Route Class Reference
+ Collaboration diagram for FastRoute\Route:

Public Member Functions

 __construct ($httpMethod, $handler, $regex, $variables)
 Constructs a route (value object). More...
 
 matches ($str)
 Tests whether this route matches the given string. More...
 

Data Fields

 $httpMethod
 
 $regex
 
 $variables
 
 $handler
 

Detailed Description

Definition at line 5 of file Route.php.

Constructor & Destructor Documentation

◆ __construct()

FastRoute\Route::__construct (   $httpMethod,
  $handler,
  $regex,
  $variables 
)

Constructs a route (value object).

Parameters
string$httpMethod
mixed$handler
string$regex
array$variables

Definition at line 27 of file Route.php.

References $handler.

28  {
29  $this->httpMethod = $httpMethod;
30  $this->handler = $handler;
31  $this->regex = $regex;
32  $this->variables = $variables;
33  }

Member Function Documentation

◆ matches()

FastRoute\Route::matches (   $str)

Tests whether this route matches the given string.

Parameters
string$str
Returns
bool

Definition at line 42 of file Route.php.

43  {
44  $regex = '~^' . $this->regex . '$~';
45  return (bool) preg_match($regex, $str);
46  }

Field Documentation

◆ $handler

FastRoute\Route::$handler

Definition at line 17 of file Route.php.

◆ $httpMethod

FastRoute\Route::$httpMethod

Definition at line 8 of file Route.php.

◆ $regex

FastRoute\Route::$regex

Definition at line 11 of file Route.php.

◆ $variables

FastRoute\Route::$variables

Definition at line 14 of file Route.php.


The documentation for this class was generated from the following file: