ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Route.php
Go to the documentation of this file.
1 <?php
2 
3 namespace FastRoute;
4 
5 class Route
6 {
8  public $httpMethod;
9 
11  public $regex;
12 
14  public $variables;
15 
17  public $handler;
18 
27  public function __construct($httpMethod, $handler, $regex, $variables)
28  {
29  $this->httpMethod = $httpMethod;
30  $this->handler = $handler;
31  $this->regex = $regex;
32  $this->variables = $variables;
33  }
34 
42  public function matches($str)
43  {
44  $regex = '~^' . $this->regex . '$~';
45  return (bool) preg_match($regex, $str);
46  }
47 }
matches($str)
Tests whether this route matches the given string.
Definition: Route.php:42
__construct($httpMethod, $handler, $regex, $variables)
Constructs a route (value object).
Definition: Route.php:27
$handler