- implementation of $smarty->default_modifiers as in Smarty2

This commit is contained in:
Uwe.Tews
2010-05-06 00:11:30 +00:00
parent df1ddc31fc
commit 2e8b7c864d
2 changed files with 28 additions and 18 deletions

View File

@@ -1,5 +1,6 @@
05/05/2010 05/05/2010
- bugfix on {insert} to cache parameter - bugfix on {insert} to cache parameter
- implementation of $smarty->default_modifiers as in Smarty2
01/05/2010 01/05/2010
- bugfix on handling of variable method names at object chaning - bugfix on handling of variable method names at object chaning

View File

@@ -49,10 +49,19 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C
// display value // display value
$this->compiler->has_output = true; $this->compiler->has_output = true;
if (isset($this->compiler->smarty->registered_filters['variable'])) { if (isset($this->compiler->smarty->registered_filters['variable'])) {
$output = '<?php echo Smarty_Internal_Filter_Handler::runFilter(\'variable\', ' . $_attr['value'] . ',$_smarty_tpl->smarty, $_smarty_tpl, ' . $_attr['filter'] . ');?>'; $output = 'Smarty_Internal_Filter_Handler::runFilter(\'variable\', ' . $_attr['value'] . ',$_smarty_tpl->smarty, $_smarty_tpl, ' . $_attr['filter'] . ')';
} else { } else {
$output = '<?php echo ' . $_attr['value'] . ';?>'; $output = $_attr['value'];
} }
if (!isset($_attr['nofilter']) && isset($this->compiler->smarty->default_modifiers)) {
foreach ($this->compiler->smarty->default_modifiers as $default_modifier) {
$mod_array = explode (':', $default_modifier);
$modifier = $mod_array[0];
$mod_array[0] = $output;
$output = $this->compiler->compileTag('private_modifier', array('modifier' => $modifier, 'params' => implode(", ", $mod_array)));
}
}
$output = '<?php echo ' . $output . ';?>';
} }
return $output; return $output;
} }