I have a variable named {$user.login} that I use in a URL like this:
http://profiles.mysite.com/{$user.login}
I want to replace spaces with + symbols like this:
“User name” becomes “User+name”.
This way, my links will be cleaner.
Instead of http://profiles.mysite.com/User%20name I would have http://profiles.mysite.com/User+name
Any way I can do this? Thanks!
The PHP function urlencode translates spaces into
+signs.Try:
http://profiles.mysite.com/{$user.login|urlencode}in your template.