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

Url::setAbsolute

public Url::setAbsolute($absolute = TRUE) Sets the value of the absolute option for this Url. Parameters bool $absolute: (optional) Whether to make this Url absolute or not. Defaults to TRUE. Return value $this File core/lib/Drupal/Core/Url.php, line 704 Class Url Defines an object that holds information about a URL. Namespace Drupal\Core Code public function setAbsolute($absolute = TRUE) { $this->options['absolute'] = $absolute; return $this; }

Url::setOption

public Url::setOption($name, $value) Sets a specific option. See \Drupal\Core\Url::fromUri() for details on the options. Parameters string $name: The name of the option. mixed $value: The option value. Return value $this File core/lib/Drupal/Core/Url.php, line 672 Class Url Defines an object that holds information about a URL. Namespace Drupal\Core Code public function setOption($name, $value) { $this->options[$name] = $value; return $this; }

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; }

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