public function Route::__construct

Same name in this branch
  1. 9.x drupal/core/vendor/symfony/routing/Symfony/Component/Routing/Route.php \Symfony\Component\Routing\Route::__construct()
  2. 9.x drupal/core/vendor/symfony/routing/Symfony/Component/Routing/Annotation/Route.php \Symfony\Component\Routing\Annotation\Route::__construct()

Constructor.

Available options:

  • compiler_class: A class name able to compile this route instance (RouteCompiler by default)

@api

Parameters

string $pattern The pattern to match:

array $defaults An array of default parameter values:

array $requirements An array of requirements for parameters (regexes):

array $options An array of options:

File

drupal/core/vendor/symfony/routing/Symfony/Component/Routing/Route.php, line 45

Class

Route
A Route describes a route and its parameters.

Namespace

Symfony\Component\Routing

Code

public function __construct($pattern, array $defaults = array(), array $requirements = array(), array $options = array()) {
  $this
    ->setPattern($pattern);
  $this
    ->setDefaults($defaults);
  $this
    ->setRequirements($requirements);
  $this
    ->setOptions($options);
}