Url::toString

public Url::toString($collect_bubbleable_metadata = FALSE) Generates the string URL representation for this Url object. For an external URL, the string will contain the input plus any query string or fragment specified by the options array. If this Url object was constructed from a Drupal route or from an internal URI (URIs using the internal:, base:, or entity: schemes), the returned string will either be a relative URL like /node/1 or an absolute URL like http://example.com/node/1 depending o

Url::toUriString

public Url::toUriString() Generates a URI string that represents the data in the Url object. The URI will typically have the scheme of route: even if the object was constructed using an entity: or internal: scheme. A internal: URI that does not match a Drupal route with be returned here with the base: scheme, and external URLs will be returned in their original form. Return value string A URI representation of the Url object data. File core/lib/Drupal/Core/Url.php, line 511 Class Url Defi

Url::toRenderArray

public Url::toRenderArray() Returns the route information for a render array. Return value array An associative array suitable for a render array. File core/lib/Drupal/Core/Url.php, line 744 Class Url Defines an object that holds information about a URL. Namespace Drupal\Core Code public function toRenderArray() { $render_array = [ '#url' => $this, '#options' => $this->getOptions(), ]; if (!$this->unrouted) { $render_array['#access_callback'] = [get_class

Url::unroutedUrlAssembler

protected Url::unroutedUrlAssembler() Gets the unrouted URL assembler for non-Drupal URLs. Return value \Drupal\Core\Utility\UnroutedUrlAssemblerInterface The unrouted URL assembler. File core/lib/Drupal/Core/Url.php, line 838 Class Url Defines an object that holds information about a URL. Namespace Drupal\Core Code protected function unroutedUrlAssembler() { if (!$this->urlAssembler) { $this->urlAssembler = \Drupal::service('unrouted_url_assembler'); } return $this-&g

Url::setUrlGenerator

public Url::setUrlGenerator(UrlGeneratorInterface $url_generator = NULL) Sets the URL generator. Parameters \Drupal\Core\Routing\UrlGeneratorInterface $url_generator: (optional) The URL generator, specify NULL to reset it. Return value $this File core/lib/Drupal/Core/Url.php, line 853 Class Url Defines an object that holds information about a URL. Namespace Drupal\Core Code public function setUrlGenerator(UrlGeneratorInterface $url_generator = NULL) { $this->urlGenerator = $url_

Url::setRouteParameter

public Url::setRouteParameter($key, $value) Sets a specific route parameter. Parameters string $key: The key of the route parameter. mixed $value: The route parameter. Return value $this Throws \UnexpectedValueException. If this is a URI with no corresponding route. File core/lib/Drupal/Core/Url.php, line 608 Class Url Defines an object that holds information about a URL. Namespace Drupal\Core Code public function setRouteParameter($key, $value) { if ($this->unrouted) { thr

Url::setUnrouted

protected Url::setUnrouted() Sets this Url to encapsulate an unrouted URI. Return value $this File core/lib/Drupal/Core/Url.php, line 489 Class Url Defines an object that holds information about a URL. Namespace Drupal\Core Code protected function setUnrouted() { $this->unrouted = TRUE; // What was passed in as the route name is actually the URI. // @todo Consider fixing this in https://www.drupal.org/node/2346787. $this->uri = $this->routeName; // Set empty route n

Url::setRouteParameters

public Url::setRouteParameters($parameters) Sets the route parameters. Parameters array $parameters: The array of parameters. Return value $this Throws \UnexpectedValueException. If this is a URI with no corresponding route. File core/lib/Drupal/Core/Url.php, line 587 Class Url Defines an object that holds information about a URL. Namespace Drupal\Core Code public function setRouteParameters($parameters) { if ($this->unrouted) { throw new \UnexpectedValueException('External

Url::setUnroutedUrlAssembler

public Url::setUnroutedUrlAssembler(UnroutedUrlAssemblerInterface $url_assembler) Sets the unrouted URL assembler. Parameters \Drupal\Core\Utility\UnroutedUrlAssemblerInterface $url_assembler: The unrouted URL assembler. Return value $this File core/lib/Drupal/Core/Url.php, line 867 Class Url Defines an object that holds information about a URL. Namespace Drupal\Core Code public function setUnroutedUrlAssembler(UnroutedUrlAssemblerInterface $url_assembler) { $this->urlAssembler

Url::renderAccess

public static Url::renderAccess(array $element) Checks a Url render element against applicable access check services. Parameters array $element: A render element as returned from \Drupal\Core\Url::toRenderArray(). Return value bool Returns TRUE if the current user has access to the url, otherwise FALSE. File core/lib/Drupal/Core/Url.php, line 805 Class Url Defines an object that holds information about a URL. Namespace Drupal\Core Code public static function renderAccess(array $eleme