mirror of
https://github.com/smarty-php/smarty.git
synced 2025-10-14 13:05:19 +02:00
fix config_load, compile fetched arrays to compile_dir, switch display
back to runtime. clean up var names and function names, split up compile testing and compiling to separate funcs, rename some template_* functions to file_* functions and update logic so they can be used for file resources other than templates.
This commit is contained in:
@@ -17,19 +17,19 @@
|
||||
* @param array
|
||||
* @param Smarty
|
||||
*/
|
||||
function smarty_function_eval($params, &$this)
|
||||
function smarty_function_eval($params, &$smarty)
|
||||
{
|
||||
extract($params);
|
||||
|
||||
if (!isset($var)) {
|
||||
$this->trigger_error("eval: missing 'var' parameter");
|
||||
$smarty->trigger_error("eval: missing 'var' parameter");
|
||||
return;
|
||||
}
|
||||
if($var == '') {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->_compile_template("evaluated template", $var, $source);
|
||||
$smarty->_compile_template("evaluated template", $var, $source);
|
||||
|
||||
ob_start();
|
||||
eval('?>' . $source);
|
||||
@@ -37,7 +37,7 @@ function smarty_function_eval($params, &$this)
|
||||
ob_end_clean();
|
||||
|
||||
if (!empty($assign)) {
|
||||
$this->assign($assign, $contents);
|
||||
$smarty->assign($assign, $contents);
|
||||
} else {
|
||||
return $contents;
|
||||
}
|
||||
|
Reference in New Issue
Block a user