You are here

public function Route::setRequirement in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/routing/Route.php \Symfony\Component\Routing\Route::setRequirement()

Sets a requirement for the given key.

Parameters

string $key The key:

string $regex The regex:

Return value

Route The current Route instance

File

vendor/symfony/routing/Route.php, line 572

Class

Route
A Route describes a route and its parameters.

Namespace

Symfony\Component\Routing

Code

public function setRequirement($key, $regex) {
  $this->requirements[$key] = $this
    ->sanitizeRequirement($key, $regex);
  $this->compiled = null;
  return $this;
}