mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 10:24:26 +02:00
*** empty log message ***
This commit is contained in:
3
NEWS
3
NEWS
@@ -1,6 +1,7 @@
|
|||||||
Version 2.0
|
Version 2.0
|
||||||
-----------
|
-----------
|
||||||
- added "eval" plugin for evaluating variables as templates (Monte)
|
- added "eval" function plugin for evaluating variables as templates.
|
||||||
|
(Monte)
|
||||||
- removed $tpl_file_ext class variable, no longer used. (Monte)
|
- removed $tpl_file_ext class variable, no longer used. (Monte)
|
||||||
- added "hex" and "hexentity" escape types to escape modifier. (Monte)
|
- added "hex" and "hexentity" escape types to escape modifier. (Monte)
|
||||||
- removed dependency on PEAR. (Andrei)
|
- removed dependency on PEAR. (Andrei)
|
||||||
|
@@ -2712,13 +2712,6 @@ The value of $name is Bob.</programlisting>
|
|||||||
counter function will be assigned to this template variable instead of
|
counter function will be assigned to this template variable instead of
|
||||||
being output to the template. (new in Smarty 1.5.0)
|
being output to the template. (new in Smarty 1.5.0)
|
||||||
</para>
|
</para>
|
||||||
<note>
|
|
||||||
<para>
|
|
||||||
evaluated variables follow the same rules as templates, so for
|
|
||||||
instance PHP tags are escaped by default, or if you have
|
|
||||||
security enabled then embedding PHP is not allowed.
|
|
||||||
</para>
|
|
||||||
</note>
|
|
||||||
<example>
|
<example>
|
||||||
<title>counter</title>
|
<title>counter</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
@@ -2764,6 +2757,14 @@ OUTPUT:
|
|||||||
<entry><emphasis>n/a</emphasis></entry>
|
<entry><emphasis>n/a</emphasis></entry>
|
||||||
<entry>variable (or string) to evaluate</entry>
|
<entry>variable (or string) to evaluate</entry>
|
||||||
</row>
|
</row>
|
||||||
|
<row>
|
||||||
|
<entry>assign</entry>
|
||||||
|
<entry>string</entry>
|
||||||
|
<entry>No</entry>
|
||||||
|
<entry><emphasis>n/a</emphasis></entry>
|
||||||
|
<entry>the template variable the output will be assigned
|
||||||
|
to</entry>
|
||||||
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
</tgroup>
|
</tgroup>
|
||||||
</informaltable>
|
</informaltable>
|
||||||
|
@@ -17,15 +17,15 @@ function smarty_function_eval($params, &$this)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->_compile_template("eval_var",$var,$source);
|
$this->_compile_template("evaluated template", $var, $source);
|
||||||
|
|
||||||
if (!empty($assign)) {
|
if (!empty($assign)) {
|
||||||
ob_start();
|
ob_start();
|
||||||
eval('?>'.$source);
|
eval('?>' . $source);
|
||||||
$this->assign($assign,ob_get_contents());
|
$this->assign($assign, ob_get_contents());
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
} else {
|
} else {
|
||||||
eval('?>'.$source);
|
eval('?>' . $source);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -17,15 +17,15 @@ function smarty_function_eval($params, &$this)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->_compile_template("eval_var",$var,$source);
|
$this->_compile_template("evaluated template", $var, $source);
|
||||||
|
|
||||||
if (!empty($assign)) {
|
if (!empty($assign)) {
|
||||||
ob_start();
|
ob_start();
|
||||||
eval('?>'.$source);
|
eval('?>' . $source);
|
||||||
$this->assign($assign,ob_get_contents());
|
$this->assign($assign, ob_get_contents());
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
} else {
|
} else {
|
||||||
eval('?>'.$source);
|
eval('?>' . $source);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user