W3cubDocs

/Drupal 8

class UrlHelper

Helper class URL based methods.

Hierarchy

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 array into a valid, rawurlencoded query string.
UrlHelper::encodePath public static function Encodes a Drupal path for use in a URL.
UrlHelper::externalIsLocal public static function Determines if an external URL points to this installation.
UrlHelper::filterBadProtocol public static function Processes an HTML attribute value and strips dangerous protocols from URLs.
UrlHelper::filterQueryParameters public static function Filters a URL query parameter array to remove unwanted elements.
UrlHelper::getAllowedProtocols public static function Gets the allowed protocols.
UrlHelper::isExternal public static function Determines whether a path is external to Drupal.
UrlHelper::isValid public static function Verifies the syntax of the given URL.
UrlHelper::parse public static function Parses a URL string into its path, query, and fragment components.
UrlHelper::setAllowedProtocols public static function Sets the allowed protocols.
UrlHelper::stripDangerousProtocols public static function Strips dangerous protocols (for example, 'javascript:') from a URI.

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Component!Utility!UrlHelper.php/class/UrlHelper/8.1.x