urlEncode — URL – encodes a string


This method is useful when encoding a string  that can be used in a query part of a URL. After encoding all non-Alphanumeric characters will be replaced with a % sign except the  -_. characters followed by two hexadecimal digits. The space will be replaced with + sign.

Minimum number of  arguments for this method is one.

Structure of the method:



string— is the string or URL we want to URL-encode


In the example below, we URL-encode a given URL string.

{% set result = urlEncode('https//')%} 


To stay updated with the latest features, news and how-to articles and videos, please join our group on Facebook, Flexie CRM Academy.