X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;ds=sidebyside;f=wwwroot%2Fsmarty%2FSmarty-2.6.10%2Flibs%2Fplugins%2Ffunction.eval.php;fp=wwwroot%2Fsmarty%2FSmarty-2.6.10%2Flibs%2Fplugins%2Ffunction.eval.php;h=3a4b8b2b8c4e3514e7352849084b8979f27432bd;hb=51ff32267c4949bad6a8dddc502cbc01ed56edc8;hp=0000000000000000000000000000000000000000;hpb=dcee763368a1e3f380d07320a5254d91a09304e6;p=mirrors%2FKyberia-bloodline.git diff --git a/wwwroot/smarty/Smarty-2.6.10/libs/plugins/function.eval.php b/wwwroot/smarty/Smarty-2.6.10/libs/plugins/function.eval.php new file mode 100644 index 0000000..3a4b8b2 --- /dev/null +++ b/wwwroot/smarty/Smarty-2.6.10/libs/plugins/function.eval.php @@ -0,0 +1,48 @@ + + * Name: eval
+ * Purpose: evaluate a template variable as a template
+ * @link http://smarty.php.net/manual/en/language.function.eval.php {eval} + * (Smarty online manual) + * @param array + * @param Smarty + */ +function smarty_function_eval($params, &$smarty) +{ + + if (!isset($params['var'])) { + $smarty->trigger_error("eval: missing 'var' parameter"); + return; + } + + if($params['var'] == '') { + return; + } + + $smarty->_compile_source('evaluated template', $params['var'], $_var_compiled); + + ob_start(); + $smarty->_eval('?>' . $_var_compiled); + $_contents = ob_get_contents(); + ob_end_clean(); + + if (!empty($params['assign'])) { + $smarty->assign($params['assign'], $_contents); + } else { + return $_contents; + } +} + +/* vim: set expandtab: */ + +?>