10 * Smarty {eval} function plugin
14 * Purpose: evaluate a template variable as a template<br>
15 * @link http://smarty.php.net/manual/en/language.function.eval.php {eval}
16 * (Smarty online manual)
17 * @author Monte Ohrt <monte at ohrt dot com>
21 function smarty_function_eval($params, &$smarty)
24 if (!isset($params['var'])) {
25 $smarty->trigger_error("eval: missing 'var' parameter");
29 if($params['var'] == '') {
33 $smarty->_compile_source('evaluated template', $params['var'], $_var_compiled);
36 $smarty->_eval('?>' . $_var_compiled);
37 $_contents = ob_get_contents();
40 if (!empty($params['assign'])) {
41 $smarty->assign($params['assign'], $_contents);
47 /* vim: set expandtab: */
This page took 0.381584 seconds and 4 git commands to generate.