UnroutedUrlAssembler

Provides a way to build external or non Drupal local domain URLs. It takes into account configured safe HTTP protocols. Hierarchy class \Drupal\Core\Utility\UnroutedUrlAssembler implements UnroutedUrlAssemblerInterface File core/lib/Drupal/Core/Utility/UnroutedUrlAssembler.php, line 15 Namespace Drupal\Core\Utility Members Name Modifiers Type Description UnroutedUrlAssembler::$pathProcessor protected property The outbound path processor. UnroutedUrlAssembler::$requestS

UnroutedUrlAssembler::$pathProcessor

The outbound path processor. Type: \Drupal\Core\PathProcessor\OutboundPathProcessorInterface File core/lib/Drupal/Core/Utility/UnroutedUrlAssembler.php, line 29 Class UnroutedUrlAssembler Provides a way to build external or non Drupal local domain URLs. Namespace Drupal\Core\Utility Code protected $pathProcessor;

UnroutedUrlAssembler::$requestStack

A request stack object. Type: \Symfony\Component\HttpFoundation\RequestStack File core/lib/Drupal/Core/Utility/UnroutedUrlAssembler.php, line 22 Class UnroutedUrlAssembler Provides a way to build external or non Drupal local domain URLs. Namespace Drupal\Core\Utility Code protected $requestStack;

UnroutedUrlAssembler::addOptionDefaults

protected UnroutedUrlAssembler::addOptionDefaults(array &$options) Merges in default defaults Parameters array $options: The options to merge in the defaults. File core/lib/Drupal/Core/Utility/UnroutedUrlAssembler.php, line 165 Class UnroutedUrlAssembler Provides a way to build external or non Drupal local domain URLs. Namespace Drupal\Core\Utility Code protected function addOptionDefaults(array &$options) { $request = $this->requestStack->getCurrentRequest(); $curre

UnroutedUrlAssembler::assemble

public UnroutedUrlAssembler::assemble($uri, array $options = [], $collect_bubbleable_metadata = FALSE) This is a helper function that calls buildExternalUrl() or buildLocalUrl() based on a check of whether the path is a valid external URL. Overrides UnroutedUrlAssemblerInterface::assemble File core/lib/Drupal/Core/Utility/UnroutedUrlAssembler.php, line 53 Class UnroutedUrlAssembler Provides a way to build external or non Drupal local domain URLs. Namespace Drupal\Core\Utility Code pub

UnroutedUrlAssembler::buildExternalUrl

protected UnroutedUrlAssembler::buildExternalUrl($uri, array $options = [], $collect_bubbleable_metadata = FALSE) File core/lib/Drupal/Core/Utility/UnroutedUrlAssembler.php, line 70 Class UnroutedUrlAssembler Provides a way to build external or non Drupal local domain URLs. Namespace Drupal\Core\Utility Code protected function buildExternalUrl($uri, array $options = [], $collect_bubbleable_metadata = FALSE) { $this->addOptionDefaults($options); // Split off the fragment. if (s

UnroutedUrlAssembler::buildLocalUrl

protected UnroutedUrlAssembler::buildLocalUrl($uri, array $options = [], $collect_bubbleable_metadata = FALSE) File core/lib/Drupal/Core/Utility/UnroutedUrlAssembler.php, line 101 Class UnroutedUrlAssembler Provides a way to build external or non Drupal local domain URLs. Namespace Drupal\Core\Utility Code protected function buildLocalUrl($uri, array $options = [], $collect_bubbleable_metadata = FALSE) { $generated_url = $collect_bubbleable_metadata ? new GeneratedUrl() : NULL; $t

UnroutedUrlAssembler::__construct

public UnroutedUrlAssembler::__construct(RequestStack $request_stack, OutboundPathProcessorInterface $path_processor, array $filter_protocols = ['http', 'https']) Constructs a new unroutedUrlAssembler object. Parameters \Symfony\Component\HttpFoundation\RequestStack $request_stack: A request stack object. \Drupal\Core\PathProcessor\OutboundPathProcessorInterface $path_processor: The output path processor. string[] $filter_protocols: (optional) An array of protocols allowed for URL generation.

UnroutedUrlAssemblerInterface

Provides a way to build external or non Drupal local domain URLs. Hierarchy interface \Drupal\Core\Utility\UnroutedUrlAssemblerInterface File core/lib/Drupal/Core/Utility/UnroutedUrlAssemblerInterface.php, line 8 Namespace Drupal\Core\Utility Members Name Modifiers Type Description UnroutedUrlAssemblerInterface::assemble public function Builds a domain-local or external URL from a URI.

UnroutedUrlAssemblerInterface::assemble

public UnroutedUrlAssemblerInterface::assemble($uri, array $options = array(), $collect_bubbleable_metadata = FALSE) Builds a domain-local or external URL from a URI. For actual implementations the logic probably has to be split up between domain-local URIs and external URLs. Parameters string $uri: A local URI or an external URL being linked to, such as "base:foo" or "http://example.com/foo". If you provide a full URL, it will be considered an external URL as long as it has an allowed protoco