XOOPS 2.5.6
Final
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Pages
function.eval.php
Go to the documentation of this file.
1
<?php
21
function
smarty_function_eval
($params, &$smarty)
22
{
23
24
if
(!isset($params[
'var'
])) {
25
$smarty->trigger_error(
"eval: missing 'var' parameter"
);
26
return
;
27
}
28
29
if
($params[
'var'
] ==
''
) {
30
return
;
31
}
32
33
$smarty->_compile_source(
'evaluated template'
, $params[
'var'
], $_var_compiled);
34
35
ob_start();
36
$smarty->_eval(
'?>'
. $_var_compiled);
37
$_contents = ob_get_contents();
38
ob_end_clean();
39
40
if
(!empty($params[
'assign'
])) {
41
$smarty->assign($params[
'assign'
], $_contents);
42
}
else
{
43
return
$_contents;
44
}
45
}
46
47
/* vim: set expandtab: */
48
49
?>
L:
0xoops
xoops-2.5.6
htdocs
class
smarty
plugins
function.eval.php
Generated on Fri May 10 2013 01:04:24 for XOOPS 2.5.6 by
1.8.3.1