mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
fixed assign parameter for eval (must have gotton lost on its way to 2.5.0)
cleaned up indentiation
This commit is contained in:
@@ -25,21 +25,21 @@ function smarty_function_eval($params, &$smarty)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($params['var'] == '') {
|
if($params['var'] == '') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$smarty->_compile_source('evaluated template', $params['var'], $_var_compiled);
|
$smarty->_compile_source('evaluated template', $params['var'], $_var_compiled);
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
$smarty->smarty_eval('?>' . $_var_compiled);
|
$smarty->smarty_eval('?>' . $_var_compiled);
|
||||||
$_contents = ob_get_contents();
|
$_contents = ob_get_contents();
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
|
|
||||||
if (!empty($assign)) {
|
if (!empty($params['assign'])) {
|
||||||
$smarty->assign($assign, $_contents);
|
$smarty->assign($params['assign'], $_contents);
|
||||||
} else {
|
} else {
|
||||||
return $_contents;
|
return $_contents;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user