public function Route::setPattern

Same name in this branch

Sets the pattern.

This method implements a fluent interface.

Parameters

string $pattern The pattern:

Return value

Route The current Route instance

1 call to Route::setPattern()
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 96

Class

Route
A Route describes a route and its parameters.

Namespace

Symfony\Component\Routing

Code

public function setPattern($pattern) {
  $this->pattern = trim($pattern);

  // a route must start with a slash
  if ('' === $this->pattern || '/' !== $this->pattern[0]) {
    $this->pattern = '/' . $this->pattern;
  }
  $this->compiled = null;
  return $this;
}