Like my work? If you're looking for a Bracknell Web Design Agency then drop us a line at 'Nine Four' and we can hook up for a chat.

ExpressionEngine Plug-in: Encode/Decode Tuesday July 22, 2008

Every time I come up against something which I once would have resorted to PHP to solve, I end up writing a little plug-in these days instead. It just feels less dirty that way…

Anyhow, this one was developed to help me out when I needed to pass a string of data from one page to another in the URL. The string in question would occasionally include a forward slash and as such the string would become split as Expression Engine interpreted it as two separate URL segments.

The ‘Encode/Decode’ plug-in takes any string of text and encodes or decodes it. Typical usage of the plug-in is as follows:

{exp:np_encodedecode style="base64" direction="encode"}{title}{/exp:np_encodedecode}

The plug-in offers ‘base64’ and ‘url’ encoding and decoding but it would be easy to add more options. For me base64 seems to work best.

Download: pi.np_encodedecode.php.zip

Obviously let me know in the comments if you have any thoughts on how this can be improved. Enjoy!

Posted in: ExpressionEngine

 
Play online poker at Full Tilt Poker and PokerStars. The best online poker rooms still open to US players. welike-Poker.com provides unbiased and critical online poker room reviews.
Leave your comments
name:
email: Gravatar enabled.
http://
Format your message with Textile.
Remember

related

recently

The 10 most recent articles.