mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 19:34:27 +02:00
Minor tweaks and corrections
This commit is contained in:
@@ -79,7 +79,7 @@
|
|||||||
<entry>boolean</entry>
|
<entry>boolean</entry>
|
||||||
<entry>No</entry>
|
<entry>No</entry>
|
||||||
<entry><emphasis>&true;</emphasis></entry>
|
<entry><emphasis>&true;</emphasis></entry>
|
||||||
<entry>determines whether or not to show this section</entry>
|
<entry>Determines whether or not to show this section</entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
</tgroup>
|
</tgroup>
|
||||||
@@ -142,7 +142,9 @@
|
|||||||
|
|
||||||
<example>
|
<example>
|
||||||
<title>Looping a simple array with {section}</title>
|
<title>Looping a simple array with {section}</title>
|
||||||
<para><link linkend="api.assign">assign()</link> an array to Smarty from the php script</para>
|
<para>
|
||||||
|
<link linkend="api.assign"><varname>assign()</varname></link> an array to Smarty
|
||||||
|
</para>
|
||||||
<programlisting role="php">
|
<programlisting role="php">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
<?php
|
<?php
|
||||||
@@ -226,9 +228,9 @@ id: 1000<br />
|
|||||||
|
|
||||||
|
|
||||||
<example>
|
<example>
|
||||||
<title>Looping an associative array's with {section}</title>
|
<title>Looping an associative array with {section}</title>
|
||||||
<para>This is an example of printing an associative array
|
<para>This is an example of printing an associative array
|
||||||
of data within a <varname>{section}</varname>. Following is the php script to assign the
|
of data with a <varname>{section}</varname>. Following is the php script to assign the
|
||||||
<parameter>$contacts</parameter> array to Smarty.</para>
|
<parameter>$contacts</parameter> array to Smarty.</para>
|
||||||
<programlisting role="php">
|
<programlisting role="php">
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
@@ -465,7 +467,7 @@ $smarty->assign('contacts', $db->getAll($sql));
|
|||||||
<title>.index</title>
|
<title>.index</title>
|
||||||
<para>
|
<para>
|
||||||
<parameter>index</parameter> contains the current array index, starting with zero
|
<parameter>index</parameter> contains the current array index, starting with zero
|
||||||
or the <parameter>start</parameter> attribute if given It increments by one or by
|
or the <parameter>start</parameter> attribute if given. It increments by one or by
|
||||||
the <parameter>step</parameter> attribute if given.
|
the <parameter>step</parameter> attribute if given.
|
||||||
</para>
|
</para>
|
||||||
<note>
|
<note>
|
||||||
@@ -482,8 +484,8 @@ $smarty->assign('contacts', $db->getAll($sql));
|
|||||||
<title>{section} <varname>index</varname> property</title>
|
<title>{section} <varname>index</varname> property</title>
|
||||||
<para>
|
<para>
|
||||||
<note><title>FYI</title>
|
<note><title>FYI</title>
|
||||||
<para><parameter>$custid[customer.index]</parameter> and <varname>$custid[customer]</varname>
|
<para><literal>$custid[customer.index]</literal> and
|
||||||
are identical in meaning.</para>
|
<literal>$custid[customer]</literal> are identical.</para>
|
||||||
</note>
|
</note>
|
||||||
</para>
|
</para>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
@@ -598,8 +600,8 @@ $smarty->assign('arr',$id);
|
|||||||
?>
|
?>
|
||||||
]]>
|
]]>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
<para>Template to output every other element of the <varname>$arr</varname>
|
<para>Template to output every other element of the <literal>$arr</literal>
|
||||||
array as <varname>step</varname>=2</para>
|
array as <literal>step=2</literal></para>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
{section name=cu loop=$arr start=5 step=2}
|
{section name=cu loop=$arr start=5 step=2}
|
||||||
@@ -623,10 +625,10 @@ iteration=6 index=15 id=3015<br />
|
|||||||
]]>
|
]]>
|
||||||
</screen>
|
</screen>
|
||||||
<para>
|
<para>
|
||||||
Another example uses the <parameter>iteration</parameter> property to
|
Another example that uses the <parameter>iteration</parameter> property to
|
||||||
output a table header block every five rows and
|
output a table header block every five rows.
|
||||||
uses <link linkend="language.function.if"><varname>{if}</varname></link>
|
Uses the <link linkend="language.function.if"><varname>{if}</varname></link>
|
||||||
with the mod operator.
|
function with the mod operator.
|
||||||
</para>
|
</para>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
@@ -653,8 +655,8 @@ iteration=6 index=15 id=3015<br />
|
|||||||
<sect2 id="section.property.first">
|
<sect2 id="section.property.first">
|
||||||
<title>.first</title>
|
<title>.first</title>
|
||||||
<para>
|
<para>
|
||||||
<parameter>first</parameter> is set to &true; if the current <varname>{section}</varname>
|
<parameter>first</parameter> is set to &true; if the current
|
||||||
iteration is the initial one.
|
<varname>{section}</varname> iteration is the initial one.
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
@@ -715,7 +717,7 @@ iteration=6 index=15 id=3015<br />
|
|||||||
looped. This can be used inside or after the <varname>{section}</varname>.
|
looped. This can be used inside or after the <varname>{section}</varname>.
|
||||||
</para>
|
</para>
|
||||||
<example>
|
<example>
|
||||||
<title>{section} property <varname>loop</varname>s</title>
|
<title>{section} property <varname>loop</varname></title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
{section name=customer loop=$custid}
|
{section name=customer loop=$custid}
|
||||||
@@ -741,8 +743,8 @@ There are 3 customers shown above.
|
|||||||
<sect2 id="section.property.show">
|
<sect2 id="section.property.show">
|
||||||
<title>.show</title>
|
<title>.show</title>
|
||||||
<para>
|
<para>
|
||||||
<parameter>show</parameter> is used as a parameter to section.
|
<parameter>show</parameter> is used as a parameter to section and is
|
||||||
<parameter>show</parameter> is a boolean value, &true; or &false;. If
|
a boolean value. If
|
||||||
&false;, the section will not be displayed. If there is a
|
&false;, the section will not be displayed. If there is a
|
||||||
<varname>{sectionelse}</varname> present, that will be alternately displayed.
|
<varname>{sectionelse}</varname> present, that will be alternately displayed.
|
||||||
</para>
|
</para>
|
||||||
|
Reference in New Issue
Block a user