optimized for loops with count() function calls

This commit is contained in:
mohrt
2002-06-03 16:05:33 +00:00
parent f1d75e32c8
commit 51a14712f8
11 changed files with 40 additions and 29 deletions
+1 -1
View File
@@ -400,7 +400,7 @@ href="mailto:%62%6f%62%40%6d%65%2e%6e%65%74">bob&a
<para>
Smarty's homepage is located at http://www.phpinsider.com/php/code/Smarty/.
You can join the mailing list by sending an e-mail to
subscribe-smarty@lists.ispi.net. An archive of the mailing list can be
smarty-general-subscribe@lists.php.net. An archive of the mailing list can be
viewed at http://marc.theaimsgroup.com/?l=smarty&amp;r=1&amp;w=2
</para>
</chapter>
+10
View File
@@ -3737,6 +3737,16 @@ OUTPUT:
math function will be assigned to this template variable instead of
being output to the template.
</para>
<note>
<title>Technical Note</title>
<para>
math is an expensive function in performance due to its use of
the php eval() function. Doing the math in PHP is much more
efficient, so whenever possible do the math calculations in PHP
and assign the results to the template. Definately avoid
repetitive math function calls, like within section loops.
</para>
</note>
<example>
<title>math</title>
<programlisting>