6 * @subpackage PluginsModifierCompiler
\r
10 * Smarty strip modifier plugin
\r
12 * Type: modifier<br>
\r
14 * Purpose: Replace all repeated spaces, newlines, tabs
\r
15 * with a single space or supplied replacement string.<br>
\r
16 * Example: {$var|strip} {$var|strip:" "}<br>
\r
17 * Date: September 25th, 2002
\r
19 * @link http://www.smarty.net/manual/en/language.modifier.strip.php strip (Smarty online manual)
\r
21 * @param array $params parameters
\r
22 * @return string with compiled code
\r
25 function smarty_modifiercompiler_strip($params, $compiler)
\r
27 if (!isset($params[1])) {
\r
30 return "preg_replace('!\s+!" . Smarty::$_UTF8_MODIFIER . "', {$params[1]},{$params[0]})";
\r