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));
}
doc_Drupal
2016-10-29 09:51:52
Comments
Leave a Comment

Please login to continue.