O'Reilly logo

CMS Made Simple Development Cookbook by Samuel Goldstein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Reversing a string in two ways using a Smarty Modifier

One of the few things that a Tag can do that a User-Defined Tag cannot, is to act as one of the more exotic Smarty tags; specifically filters and modifiers. A Smarty modifier is used, as the name suggests, to modify the output of a Smarty tag before it is substituted into the template.

Modifiers are typically used to do things like reformat text, convert data (dates, numeric formats, and so on). They can be used to escape certain characters to prevent cross-site scripting (XSS) attacks, or to obfuscate e-mail addresses to stymie spam harvesting programs.

This recipe shows you how to write a Smarty modifier, which can reverse strings in two different ways: order of characters and case of characters. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required