6 * @subpackage PluginsModifierCompiler
10 * Smarty default modifier plugin
14 * Purpose: designate default value for empty variables
16 * @link http://smarty.php.net/manual/en/language.modifier.default.php default (Smarty online manual)
18 * @param array $params parameters
19 * @return string with compiled code
21 function smarty_modifiercompiler_default ($params, $compiler)
24 if (!isset($params[1])) {
27 for ($i = 1, $cnt = count($params); $i < $cnt; $i++) {
28 $output = '(($tmp = @' . $output . ')===null||$tmp===\'\' ? ' . $params[$i] . ' : $tmp)';