Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Route.php

function Route::setPath

Same name in this branch
  1. 11.1.x vendor/symfony/routing/Attribute/Route.php \Symfony\Component\Routing\Attribute\Route::setPath()

Return value

$this

1 call to Route::setPath()
Route::__construct in vendor/symfony/routing/Route.php
Constructor.

File

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

Class

Route
A Route describes a route and its parameters.

Namespace

Symfony\Component\Routing

Code

public function setPath(string $pattern) : static {
    $pattern = $this->extractInlineDefaultsAndRequirements($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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal