public function PathBasedGeneratorInterface::setBasePath

Sets the basePath property.

This will be either '/' or '[subdir]/', where [subdir] is the name of the subdirectory that Drupal is running in.

The base path is usually set by the request but we allow it to be set independent of the request so that code that calls url() outside the context of a request can use the global $base_url variable to set this value.

@todo Remove this once the url() function no longer supports being called when there is no request.

The base path to use for url generation.

1 method overrides PathBasedGeneratorInterface::setBasePath()

File

drupal/core/lib/Drupal/Core/Routing/PathBasedGeneratorInterface.php, line 74
Contains Drupal\Core\Routing\PathBasedGeneratorInterface.

Class

PathBasedGeneratorInterface
Defines an interface for generating a url from a path as opposed to a route.

Namespace

Drupal\Core\Routing

Code

public function setBasePath($path);