function twig_urlencode_filter

URL encodes a string.

Parameters

string $url A URL:

bool $raw true to use rawurlencode() instead of urlencode:

Return value

string The URL encoded value

1 string reference to 'twig_urlencode_filter'
Twig_Extension_Core::getFilters in drupal/core/vendor/twig/twig/lib/Twig/Extension/Core.php
Returns a list of filters to add to the existing list.

File

drupal/core/vendor/twig/twig/lib/Twig/Extension/Core.php, line 488

Code

function twig_urlencode_filter($url, $raw = false) {
  if ($raw) {
    return rawurlencode($url);
  }
  return urlencode($url);
}