URL encodes a string.
string $url A URL:
bool $raw true to use rawurlencode() instead of urlencode:
string The URL encoded value
function twig_urlencode_filter($url, $raw = false) {
if ($raw) {
return rawurlencode($url);
}
return urlencode($url);
}