Smarty: Variable Modifiers

Variable modifiers can be applied to variables, custom functions or strings. To apply a modifier, specify the value followed by a | (pipe) and the modifier name. A modifier may accept additional parameters that affect its behavior. These parameters follow the modifier name and are separated by a : (colon). Also, all php-functions can be used as modifiers implicitly (more below) and modifiers can be combined.

Contoh

 * Modifiers can be applied to any type of variables, including arrays and objects.
 * Note
 * The default behavior was changed with Smarty 3. In Smarty 2.x, you had to use an "@" symbol to apply a modifier to an array, such as {$articleTitle|@count}. With Smarty 3, the "@" is no longer necessary, and is ignored.
 * If you want a modifier to apply to each individual item of an array, you will either need to loop the array in the template, or provide for this functionality inside your modifier function.
 * Note
 * Second, in Smarty 2.x, modifiers were applied to the result of math expressions like {8+2}, meaning that {8+2|count_characters} would give 2, as 8+2=10 and 10 is two characters long. With Smarty 3, modifiers are applied to the variables or atomic expressions before executing the calculations, so since 2 is one character long, {8+2|count_characters} gives 9. To get the old result use parentheses like {(8+2)|count_characters}.
 * Modifiers are autoloaded from the $plugins_dir or can be registered explicitly with the registerPlugin function. The later is useful for sharing a function between php scripts and smarty templates.
 * All php-functions can be used as modifiers implicitly, as demonstrated in the example above. However, using php-functions as modifiers has two little pitfalls:
 * First - sometimes the order of the function-parameters is not the desirable one. Formatting $foo with {"%2.f"|sprintf:$foo} actually works, but asks for the more intuitive, like {$foo|string_format:"%2.f"} that is provided by the Smarty distribution.
 * Secondly - if security is enabled, all php-functions that are to be used as modifiers have to be declared trusted in the $modifiers property of the securty policy. See the Security section for details.

Macam-Macam Varialbe Modifiers

 * 1) capitalize
 * 2) cat
 * 3) count_characters
 * 4) count_paragraphs
 * 5) count_sentences
 * 6) count_words
 * 7) date_format
 * 8) default
 * 9) escape
 * 10) from_charset
 * 11) indent
 * 12) lower
 * 13) nl2br
 * 14) regex_replace
 * 15) replace
 * 16) spacify
 * 17) string_format
 * 18) strip
 * 19) strip_tags
 * 20) to_charset
 * 21) truncate
 * 22) unescape
 * 23) upper
 * 24) wordwrap

Sumber
https://www.smarty.net/docs/en/language.modifiers.tpl