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

public static Url::validateUrl(&$element, FormStateInterface $form_state, &$complete_form) Form element validation handler for #type 'url'. Note that #maxlength and #required is validated by _form_validate() already. File core/lib/Drupal/Core/Render/Element/Url.php, line 62 Class Url Provides a form element for input of a URL. Namespace Drupal\Core\Render\Element Code public static function validateUrl(&$element, FormStateInterface $form_state, &$complete_form) { $val

Url::__construct

public Url::__construct($route_name, $route_parameters = array(), $options = array()) Constructs a new Url object. In most cases, use Url::fromRoute() or Url::fromUri() rather than constructing Url objects directly in order to avoid ambiguity and make your code more self-documenting. @todo Update this documentation for non-routed URIs in https://www.drupal.org/node/2346787 Parameters string $route_name: The name of the route array $route_parameters: (optional) An associative array of parameter

UrlGenerator

Generates URLs from route names and parameters. Hierarchy class \Drupal\Core\Routing\UrlGenerator implements UrlGeneratorInterface File core/lib/Drupal/Core/Routing/UrlGenerator.php, line 20 Namespace Drupal\Core\Routing Members Name Modifiers Type Description UrlGenerator::$context protected property UrlGenerator::$decodedChars protected property Overrides characters that will not be percent-encoded in the path segment. UrlGenerator::$pathProcessor protected

UrlGenerator::$context

Type: RequestContext File core/lib/Drupal/Core/Routing/UrlGenerator.php, line 25 Class UrlGenerator Generates URLs from route names and parameters. Namespace Drupal\Core\Routing Code protected $context;

UrlGenerator::$decodedChars

Overrides characters that will not be percent-encoded in the path segment. The first two elements are the first two parameters of str_replace(), so if you override this variable you can also use arrays for the encoded and decoded characters. See also \Symfony\Component\Routing\Generator\UrlGenerator File core/lib/Drupal/Core/Routing/UrlGenerator.php, line 57 Class UrlGenerator Generates URLs from route names and parameters. Namespace Drupal\Core\Routing Code protected $decodedChars =

UrlGenerator::$pathProcessor

The path processor to convert the system path to one suitable for urls. Type: \Drupal\Core\PathProcessor\OutboundPathProcessorInterface File core/lib/Drupal/Core/Routing/UrlGenerator.php, line 39 Class UrlGenerator Generates URLs from route names and parameters. Namespace Drupal\Core\Routing Code protected $pathProcessor;