public function Route::setPath

Same name in this branch

Sets the pattern for the path.

This method implements a fluent interface.

Parameters

string $pattern The path pattern:

Return value

Route The current Route instance

2 calls to Route::setPath()
Route::setPattern in drupal/core/vendor/symfony/routing/Symfony/Component/Routing/Route.php
Sets the pattern for the path.
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 170

Class

Route
A Route describes a route and its parameters.

Namespace

Symfony\Component\Routing

Code

public function setPath($pattern) {

  // A pattern must start with a slash and must not have multiple slashes at the beginning because the
  // generated path for this route would be confused with a network path, e.g. '//domain.com/path'.
  $this->path = '/' . ltrim(trim($pattern), '/');
  $this->compiled = null;
  return $this;
}