/[cvs]/nfo/php/libs/net.php.smarty/plugins/function.eval.php
ViewVC logotype

Contents of /nfo/php/libs/net.php.smarty/plugins/function.eval.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Wed Oct 9 00:53:36 2002 UTC (21 years, 10 months ago) by cvsjoko
Branch: MAIN
no message

1 <?php
2
3 /*
4 * Smarty plugin
5 * -------------------------------------------------------------
6 * Type: function
7 * Name: eval
8 * Purpose: evaluate a template variable as a template
9 * -------------------------------------------------------------
10 */
11 function smarty_function_eval($params, &$this)
12 {
13 extract($params);
14
15 if (!isset($var)) {
16 $this->trigger_error("eval: missing 'var' parameter");
17 return;
18 }
19 if($var == '') {
20 return;
21 }
22
23 $this->_compile_template("evaluated template", $var, $source);
24
25 if (!empty($assign)) {
26 ob_start();
27 eval('?>' . $source);
28 $this->assign($assign, ob_get_contents());
29 ob_end_clean();
30 } else {
31 eval('?>' . $source);
32 }
33 }
34
35 /* vim: set expandtab: */
36
37 ?>

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed