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::urlGenerator

protected Url::urlGenerator() Gets the URL generator. Return value \Drupal\Core\Routing\UrlGeneratorInterface The URL generator. File core/lib/Drupal/Core/Url.php, line 825 Class Url Defines an object that holds information about a URL. Namespace Drupal\Core Code protected function urlGenerator() { if (!$this->urlGenerator) { $this->urlGenerator = \Drupal::urlGenerator(); } return $this->urlGenerator; }

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::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::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::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::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::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::setOptions

public Url::setOptions($options) Sets the URL options. Parameters array $options: The array of options. See \Drupal\Core\Url::fromUri() for details on what it contains. Return value $this File core/lib/Drupal/Core/Url.php, line 655 Class Url Defines an object that holds information about a URL. Namespace Drupal\Core Code public function setOptions($options) { $this->options = $options; return $this; }