UrlHelper::getAllowedProtocols

public static UrlHelper::getAllowedProtocols() Gets the allowed protocols. Return value array An array of protocols, for example http, https and irc. File core/lib/Drupal/Component/Utility/UrlHelper.php, line 287 Class UrlHelper Helper class URL based methods. Namespace Drupal\Component\Utility Code public static function getAllowedProtocols() { return static::$allowedProtocols; }

UrlHelper::filterBadProtocol

public static UrlHelper::filterBadProtocol($string) Processes an HTML attribute value and strips dangerous protocols from URLs. Parameters string $string: The string with the attribute value. Return value string Cleaned up and HTML-escaped version of $string. File core/lib/Drupal/Component/Utility/UrlHelper.php, line 274 Class UrlHelper Helper class URL based methods. Namespace Drupal\Component\Utility Code public static function filterBadProtocol($string) { // Get the plain text r

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

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

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 \

UrlGeneratorTrait::getUrlGenerator

protected UrlGeneratorTrait::getUrlGenerator() Returns the URL generator service. Return value \Drupal\Core\Routing\UrlGeneratorInterface The URL generator service. File core/lib/Drupal/Core/Routing/UrlGeneratorTrait.php, line 73 Class UrlGeneratorTrait Wrapper methods for the Url Generator. Namespace Drupal\Core\Routing Code protected function getUrlGenerator() { if (!$this->urlGenerator) { $this->urlGenerator = \Drupal::service('url_generator'); } return $this->ur

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