mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 11:24:27 +02:00
- bugfix default parameter values did not work for template functions included with {include}
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
27/10/2010
|
||||||
|
- bugfix default parameter values did not work for template functions included with {include}
|
||||||
|
|
||||||
25/10/2010
|
25/10/2010
|
||||||
- bugfix for E_NOTICE change, array elements did not work as modifier parameter
|
- bugfix for E_NOTICE change, array elements did not work as modifier parameter
|
||||||
|
|
||||||
|
@@ -43,6 +43,7 @@ class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase {
|
|||||||
$output = "<?php if (!function_exists('smarty_template_function_{$_name}')) {
|
$output = "<?php if (!function_exists('smarty_template_function_{$_name}')) {
|
||||||
function smarty_template_function_{$_name}(\$_smarty_tpl,\$params) {
|
function smarty_template_function_{$_name}(\$_smarty_tpl,\$params) {
|
||||||
\$saved_tpl_vars = \$_smarty_tpl->tpl_vars;
|
\$saved_tpl_vars = \$_smarty_tpl->tpl_vars;
|
||||||
|
foreach (\$_smarty_tpl->smarty->template_functions['{$_name}']['parameter'] as \$key => \$value) {\$_smarty_tpl->tpl_vars[\$key] = new Smarty_variable(trim(\$value,'\''));};
|
||||||
foreach (\$params as \$key => \$value) {\$_smarty_tpl->tpl_vars[\$key] = new Smarty_variable(\$value);}?>";
|
foreach (\$params as \$key => \$value) {\$_smarty_tpl->tpl_vars[\$key] = new Smarty_variable(\$value);}?>";
|
||||||
}
|
}
|
||||||
// Init temporay context
|
// Init temporay context
|
||||||
|
Reference in New Issue
Block a user