Makes a string url safe. Or the reverse. I needed to use this for some friendly category names in a url a while back. With the release of EE 1.6, this might be obsolete, but hey, it might come in handy somewhere as well.
This is a pretty basic plugin. Underscores are replaced with a comma and a space, and hyphens are replaced with spaces.
Place the following tag in any of your templates:
{exp:urlsafe}Sides, Soups, Salads{/exp:urlsafe}
Returns: sides-soups-salads
{exp:urlsafe reverse="yes"}sides_soups_salads{/exp:urlsafe}
Returns: Sides, Soups, Salads
{exp:urlsafe reverse="yes"}sides-soups-salads{/exp:urlsafe}
Returns: Sides Soups Salads
PARAMETERS:
The tag has two (optional) parameters:
1. separator: The replacement character [OPTIONAL, defaults to hyphen ’-’]
2. reverse: makes a url safe string in to a capitalized string [OPTIONAL]
The download is now over at its designated page at masugadesign.com:
http://www.masugadesign.com/the-lab/scripts/urlsafe/
