cvs: smarty /docs designers.sgml
| From: | Messju Mohr | Date: | Sat, 26 Apr 2003 14:00:49 +0000 |
| Subject: | cvs: smarty /docs designers.sgml | ||
| Groups: | php.smarty.cvs | ||
| Request: | Send a blank email to php-smarty-cvs+get-562@lists.php.net to get a copy of this message | ||
messju Sat Apr 26 10:00:49 2003 EDT
Modified files:
/smarty/docs designers.sgml
Log:
added documentation for foreach.property.*
Index: smarty/docs/designers.sgml
diff -u smarty/docs/designers.sgml:1.63 smarty/docs/designers.sgml:1.64
--- smarty/docs/designers.sgml:1.63 Thu Apr 24 03:43:11 2003
+++ smarty/docs/designers.sgml Sat Apr 26 10:00:47 2003
@@ -1908,6 +1908,64 @@
fax: 555-3333<br>
cell: 760-1234<br></programlisting>
</example>
+
+ <para>
+ Foreach-loops also have their own variables that handle foreach properties.
+ These are indicated like so: {$smarty.foreach.foreachname.varname} with
+ foreachname being the name specified as the <emphasis>name</emphasis>
+ attribute of foreach
+ </para>
+
+
+ <sect2 id="foreach.property.iteration">
+ <title>iteration</title>
+ <para>
+ iteration is used to display the current loop iteration.
+ </para>
+ <para>
+ Iteration always starts with 1 and is incremented by one
+ one each iteration.
+ </para>
+ </sect2>
+
+ <sect2 id="foreach.property.first">
+ <title>first</title>
+ <para>
+ <emphasis>first</emphasis> is set to true if the current foreach iteration is
the first
+ one.
+ </para>
+ </sect2>
+
+ <sect2 id="foreach.property.last">
+ <title>last</title>
+ <para>
+ <emphasis>last</emphasis> is set to true if the current foreach iteration is
the last
+ one.
+ </para>
+ </sect2>
+
+ <sect2 id="foreach.property.show">
+ <title>show</title>
+ <para>
+ <emphasis>show</emphasis> is used as a parameter to foreach.
+ <emphasis>show</emphasis> is a boolean value, true or false. If
+ false, the foreach will not be displayed. If there is a foreachelse
+ present, that will be alternately displayed.
+ </para>
+
+ </sect2>
+ <sect2 id="foreach.property.total">
+ <title>total</title>
+ <para>
+ <emphasis>total</emphasis> is used to display the number of iterations that this
foreach
+ will loop. This can be used inside or after the foreach.
+ </para>
+ </sect2>
+
+
+
+
+
</sect1>
<sect1 id="language.function.include">
<title>include</title>