Forums / Developer / URL encode?

URL encode?

Author Message

Jeroen de Jong

Wednesday 25 July 2007 4:51:51 am

Is there anyway to urlencode an url (using %20 to replace empty espace between words)?
Somthing like "str_replace" in PHP?

There are many string operators (like | chr, | ord, | crc32) that convert my string into many exotic formats....BUT NO URL encode?

please help

Ɓukasz Serwatka

Wednesday 25 July 2007 7:28:11 am

Hi,

Put in your template.ini.append.php:

[PHP]
PHPOperatorList[rawurldecode]=rawurldecode
PHPOperatorList[rawurlencode]=rawurlencode

Then you can use in templates input|rawurlencode or input|rawurldecode

Remember to clear the cache once you added those settings.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog