UrlHelper::filterQueryParameters

public static UrlHelper::filterQueryParameters(array $query, array $exclude = array(), $parent = '') Filters a URL query parameter array to remove unwanted elements. Parameters array $query: An array to be processed. array $exclude: (optional) A list of $query array keys to remove. Use "parent[child]" to exclude nested items. string $parent: Internal use only. Used to build the $query array key for nested items. Return value An array containing query parameters. File core/lib/Drupal/Component

UrlHelper::isExternal

public static UrlHelper::isExternal($path) Determines whether a path is external to Drupal. An example of an external path is http://example.com. If a path cannot be assessed by Drupal's menu handler, then we must treat it as potentially insecure. Parameters string $path: The internal path or external URL being linked to, such as "node/34" or "http://example.com/foo". Return value bool TRUE or FALSE, where TRUE indicates an external path. File core/lib/Drupal/Component/Utility/UrlHelper.php,

UrlHelper::externalIsLocal

public static UrlHelper::externalIsLocal($url, $base_url) Determines if an external URL points to this installation. Parameters string $url: A string containing an external URL, such as "http://example.com/foo". string $base_url: The base URL string to check against, such as "http://example.com/" Return value bool TRUE if the URL has the same domain and base path. Throws \InvalidArgumentException Exception thrown when a either $url or $bath_url are not fully qualified. File core/lib/Drupal/C

UrlHelper::encodePath

public static UrlHelper::encodePath($path) Encodes a Drupal path for use in a URL. For aesthetic reasons slashes are not escaped. Parameters string $path: The Drupal path to encode. Return value string The encoded path. File core/lib/Drupal/Component/Utility/UrlHelper.php, line 193 Class UrlHelper Helper class URL based methods. Namespace Drupal\Component\Utility Code public static function encodePath($path) { return str_replace('%2F', '/', rawurlencode($path)); }

UrlHelper::$allowedProtocols

The list of allowed protocols. Type: array File core/lib/Drupal/Component/Utility/UrlHelper.php, line 17 Class UrlHelper Helper class URL based methods. Namespace Drupal\Component\Utility Code protected static $allowedProtocols = array('http', 'https');

UrlHelper

Helper class URL based methods. Hierarchy class \Drupal\Component\Utility\UrlHelper Related topics Utility classes and functions Overview of utility classes and functions for developers. File core/lib/Drupal/Component/Utility/UrlHelper.php, line 10 Namespace Drupal\Component\Utility Members Name Modifiers Type Description UrlHelper::$allowedProtocols protected static property The list of allowed protocols. UrlHelper::buildQuery public static function Parses an

UrlHelper::buildQuery

public static UrlHelper::buildQuery(array $query, $parent = '') Parses an array into a valid, rawurlencoded query string. rawurlencode() is RFC3986 compliant, and as a consequence RFC3987 compliant. The latter defines the required format of "URLs" in HTML5. urlencode() is almost the same as rawurlencode(), except that it encodes spaces as "+" instead of "%20". This makes its result non compliant to RFC3986 and as a consequence non compliant to RFC3987 and as a consequence not valid as a "URL" i

UrlGeneratorTrait::setUrlGenerator

public UrlGeneratorTrait::setUrlGenerator(UrlGeneratorInterface $generator) Sets the URL generator service. Parameters \Drupal\Core\Routing\UrlGeneratorInterface $generator: The url generator service. Return value $this File core/lib/Drupal/Core/Routing/UrlGeneratorTrait.php, line 88 Class UrlGeneratorTrait Wrapper methods for the Url Generator. Namespace Drupal\Core\Routing Code public function setUrlGenerator(UrlGeneratorInterface $generator) { $this->urlGenerator = $generator

UrlGeneratorTrait::url

protected UrlGeneratorTrait::url($route_name, $route_parameters = array(), $options = array()) Generates a URL or path for a specific route based on the given parameters. For details on the arguments, usage, and possible exceptions see \Drupal\Core\Routing\UrlGeneratorInterface::generateFromRoute(). Return value string The generated URL for the given route. Deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Url instead. See also \Drupal\Core\Routing\UrlGen

UrlGeneratorTrait::redirect

protected UrlGeneratorTrait::redirect($route_name, array $route_parameters = [], array $options = [], $status = 302) Returns a redirect response object for the specified route. Parameters string $route_name: The name of the route to which to redirect. array $route_parameters: (optional) Parameters for the route. array $options: (optional) An associative array of additional options. int $status: (optional) The HTTP redirect status code for the redirect. The default is 302 Found. Return value \