public function Route::setRequirements

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

Sets the requirements.

This method implements a fluent interface.

Parameters

array $requirements The requirements:

Return value

Route The current Route instance

1 call to Route::setRequirements()
Route::__construct in drupal/core/vendor/symfony/routing/Symfony/Component/Routing/Route.php
Constructor.

File

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

Class

Route
A Route describes a route and its parameters.

Namespace

Symfony\Component\Routing

Code

public function setRequirements(array $requirements) {
  $this->requirements = array();
  return $this
    ->addRequirements($requirements);
}