fixed whitespaces by Peter

This commit is contained in:
messju
2005-05-26 13:47:49 +00:00
parent b84a9d2d46
commit 4fffc09895

View File

@@ -105,10 +105,10 @@ $smarty->assign('custid',$data);
</programlisting> </programlisting>
<programlisting> <programlisting>
<![CDATA[ <![CDATA[
{* this example will print out all the values of the $custid array *} {* this example will print out all the values of the $custid array *}
{section name=customer loop=$custid} {section name=customer loop=$custid}
id: {$custid[customer]}<br /> id: {$custid[customer]}<br />
{/section} {/section}
<hr /> <hr />
{* print out all the values of the $custid array reversed *} {* print out all the values of the $custid array reversed *}
{section name=foo loop=$custid step=-1} {section name=foo loop=$custid step=-1}
@@ -121,9 +121,9 @@ $smarty->assign('custid',$data);
</para> </para>
<screen> <screen>
<![CDATA[ <![CDATA[
id: 1000<br /> id: 1000<br />
id: 1001<br /> id: 1001<br />
id: 1002<br /> id: 1002<br />
<hr /> <hr />
id: 1002<br /> id: 1002<br />
id: 1001<br /> id: 1001<br />
@@ -183,13 +183,13 @@ $smarty->assign('address',$addr);
This example assumes that $custid, $name and $address are all This example assumes that $custid, $name and $address are all
arrays containing the same number of values arrays containing the same number of values
*} *}
{section name=customer loop=$custid} {section name=customer loop=$custid}
<p> <p>
id: {$custid[customer]}<br /> id: {$custid[customer]}<br />
name: {$name[customer]}<br /> name: {$name[customer]}<br />
address: {$address[customer]} address: {$address[customer]}
</p> </p>
{/section} {/section}
]]> ]]>
</programlisting> </programlisting>
<para> <para>
@@ -198,18 +198,18 @@ $smarty->assign('address',$addr);
<screen> <screen>
<![CDATA[ <![CDATA[
<p> <p>
id: 1000<br /> id: 1000<br />
name: John Smith<br /> name: John Smith<br />
address: 253 N 45th address: 253 N 45th
</p> </p>
<p> <p>
id: 1001<br /> id: 1001<br />
name: Jack Jones<br /> name: Jack Jones<br />
address: 417 Mulberry ln address: 417 Mulberry ln
</p> </p>
<p> <p>
id: 1002<br /> id: 1002<br />
name: Jane Munson<br /> name: Jane Munson<br />
address: 5605 apple st address: 5605 apple st
</p> </p>
]]> ]]>
@@ -225,12 +225,12 @@ $smarty->assign('address',$addr);
as it is used to reference the data within the section as it is used to reference the data within the section
*} *}
{section name=anything loop=$custid} {section name=anything loop=$custid}
<p> <p>
id: {$custid[anything]}<br /> id: {$custid[anything]}<br />
name: {$name[anything]}<br /> name: {$name[anything]}<br />
address: {$address[anything]} address: {$address[anything]}
</p> </p>
{/section} {/section}
]]> ]]>
</programlisting> </programlisting>
</example> </example>
@@ -275,15 +275,15 @@ $smarty->assign('contact_info', $info);
arrays. In this example, $contact_type[customer] is an array of arrays. In this example, $contact_type[customer] is an array of
contact types for the current customer. contact types for the current customer.
*} *}
{section name=customer loop=$custid} {section name=customer loop=$custid}
<hr> <hr>
id: {$custid[customer]}<br /> id: {$custid[customer]}<br />
name: {$name[customer]}<br /> name: {$name[customer]}<br />
address: {$address[customer]}<br /> address: {$address[customer]}<br />
{section name=contact loop=$contact_type[customer]} {section name=contact loop=$contact_type[customer]}
{$contact_type[customer][contact]}: {$contact_info[customer][contact]}<br /> {$contact_type[customer][contact]}: {$contact_info[customer][contact]}<br />
{/section} {/section}
{/section} {/section}
]]> ]]>
</programlisting> </programlisting>
<para> <para>
@@ -292,28 +292,28 @@ $smarty->assign('contact_info', $info);
<screen> <screen>
<![CDATA[ <![CDATA[
<hr> <hr>
id: 1000<br /> id: 1000<br />
name: John Smith<br /> name: John Smith<br />
address: 253 N 45th<br /> address: 253 N 45th<br />
home phone: 555-555-5555<br /> home phone: 555-555-5555<br />
cell phone: 666-555-5555<br /> cell phone: 666-555-5555<br />
e-mail: john@myexample.com<br /> e-mail: john@myexample.com<br />
<hr> <hr>
id: 1001<br /> id: 1001<br />
name: Jack Jones<br /> name: Jack Jones<br />
address: 417 Mulberry ln<br /> address: 417 Mulberry ln<br />
home phone: 123-456-4<br /> home phone: 123-456-4<br />
web: www.example.com<br /> web: www.example.com<br />
<hr> <hr>
id: 1002<br /> id: 1002<br />
name: Jane Munson<br /> name: Jane Munson<br />
address: 5605 apple st<br /> address: 5605 apple st<br />
cell phone: 0457878<br /> cell phone: 0457878<br />
]]> ]]>
</screen> </screen>
</example> </example>
<example> <example>
<title>sections and associative arrays</title> <title>sections and associative arrays</title>
<programlisting role="php"> <programlisting role="php">
@@ -340,14 +340,14 @@ $smarty->assign('contacts',$data);
This is an example of printing an associative array This is an example of printing an associative array
of data within a section of data within a section
*} *}
{section name=customer loop=$contacts} {section name=customer loop=$contacts}
<p> <p>
name: {$contacts[customer].name}<br /> name: {$contacts[customer].name}<br />
home: {$contacts[customer].home}<br /> home: {$contacts[customer].home}<br />
cell: {$contacts[customer].cell}<br /> cell: {$contacts[customer].cell}<br />
e-mail: {$contacts[customer].email} e-mail: {$contacts[customer].email}
</p> </p>
{/section} {/section}
]]> ]]>
</programlisting> </programlisting>
<para> <para>
@@ -356,19 +356,19 @@ $smarty->assign('contacts',$data);
<screen> <screen>
<![CDATA[ <![CDATA[
<p> <p>
name: John Smith<br /> name: John Smith<br />
home: 555-555-5555<br /> home: 555-555-5555<br />
cell: 666-555-5555<br /> cell: 666-555-5555<br />
e-mail: john@myexample.com e-mail: john@myexample.com
</p> </p>
<p> <p>
name: Jack Jones<br /> name: Jack Jones<br />
home phone: 777-555-5555<br /> home phone: 777-555-5555<br />
cell phone: 888-555-5555<br /> cell phone: 888-555-5555<br />
e-mail: jack@myexample.com e-mail: jack@myexample.com
</p> </p>
<p> <p>
name: Jane Munson<br /> name: Jane Munson<br />
home phone: 000-555-5555<br /> home phone: 000-555-5555<br />
cell phone: 123456<br /> cell phone: 123456<br />
e-mail: jane@myexample.com e-mail: jane@myexample.com
@@ -397,7 +397,7 @@ $smarty->assign('contacts',$db->getAll($sql) );
<tr><th>&nbsp;</th><th>Name></th><th>Home</th><th>Cell</th><th>Email</th></tr> <tr><th>&nbsp;</th><th>Name></th><th>Home</th><th>Cell</th><th>Email</th></tr>
{section name=co loop=$contacts} {section name=co loop=$contacts}
<tr> <tr>
<td><a href="view.php?id={$contacts[customer].id}">view<a></td> <td><a href="view.php?id={$contacts[co].id}">view<a></td>
<td>{$contacts[co].name}</td> <td>{$contacts[co].name}</td>
<td>{$contacts[co].home}</td> <td>{$contacts[co].home}</td>
<td>{$contacts[co].cell}</td> <td>{$contacts[co].cell}</td>
@@ -413,12 +413,12 @@ $smarty->assign('contacts',$db->getAll($sql) );
<title>{sectionelse}</title> <title>{sectionelse}</title>
<programlisting> <programlisting>
<![CDATA[ <![CDATA[
{* sectionelse will execute if there are no $custid values *} {* sectionelse will execute if there are no $custid values *}
{section name=customer loop=$custid} {section name=customer loop=$custid}
id: {$custid[customer]}<br /> id: {$custid[customer]}<br />
{sectionelse} {sectionelse}
there are no values in $custid. there are no values in $custid.
{/section} {/section}
]]> ]]>
</programlisting> </programlisting>
</example> </example>
@@ -446,7 +446,7 @@ $smarty->assign('contacts',$db->getAll($sql) );
<title>Technical Note</title> <title>Technical Note</title>
<para> <para>
If the step and start section properties are not If the step and start section properties are not
modified, then this works the same as the <link modified, then this works the same as the <link
linkend="section.property.iteration">iteration</link> section linkend="section.property.iteration">iteration</link> section
property, except it starts at 0 instead of 1. property, except it starts at 0 instead of 1.
</para> </para>
@@ -457,9 +457,9 @@ $smarty->assign('contacts',$db->getAll($sql) );
<![CDATA[ <![CDATA[
{* FYI, $custid[customer.index] and $custid[customer] are identical in meaning *} {* FYI, $custid[customer.index] and $custid[customer] are identical in meaning *}
{section name=customer loop=$custid} {section name=customer loop=$custid}
{$smarty.section.customer.index} id: {$custid[customer]}<br /> {$smarty.section.customer.index} id: {$custid[customer]}<br />
{/section} {/section}
]]> ]]>
</programlisting> </programlisting>
<para> <para>
@@ -467,9 +467,9 @@ $smarty->assign('contacts',$db->getAll($sql) );
</para> </para>
<screen> <screen>
<![CDATA[ <![CDATA[
0 id: 1000<br /> 0 id: 1000<br />
1 id: 1001<br /> 1 id: 1001<br />
2 id: 1002<br /> 2 id: 1002<br />
]]> ]]>
</screen> </screen>
</example> </example>
@@ -511,8 +511,8 @@ $smarty->assign('custid',$data);
<table> <table>
<tr> <tr>
<th>index</th><th>id</th> <th>index</th><th>id</th>
<th>index_prev</th><th>prev id</th> <th>index_prev</th><th>prev_id</th>
<th>index_next</th><th>next id</th> <th>index_next</th><th>next_id</th>
</tr> </tr>
{section name=cus loop=$custid} {section name=cus loop=$custid}
<tr> <tr>
@@ -520,7 +520,7 @@ $smarty->assign('custid',$data);
<td>{$smarty.section.cus.index_prev}</td><td>{$custid[cus.index_prev]}</td> <td>{$smarty.section.cus.index_prev}</td><td>{$custid[cus.index_prev]}</td>
<td>{$smarty.section.cus.index_next}</td><td>{$custid[cus.index_next]}</td> <td>{$smarty.section.cus.index_next}</td><td>{$custid[cus.index_next]}</td>
</tr> </tr>
{/section} {/section}
</table> </table>
]]> ]]>
</programlisting> </programlisting>
@@ -529,11 +529,11 @@ $smarty->assign('custid',$data);
</para> </para>
<screen> <screen>
<![CDATA[ <![CDATA[
index id index_prev previd index_next nextid index id index_prev prev_id index_next next_id
0 1001 -1 1 1002 0 1001 -1 1 1002
1 1002 0 1001 2 1003 1 1002 0 1001 2 1003
2 1003 1 1002 3 1004 2 1003 1 1002 3 1004
3 1004 2 1003 4 1005 3 1004 2 1003 4 1005
4 1005 3 1004 5 4 1005 3 1004 5
]]> ]]>
</screen> </screen>
@@ -574,7 +574,7 @@ $smarty->assign('custid',$id);
iteration={$smarty.section.cu.iteration} iteration={$smarty.section.cu.iteration}
index={$smarty.section.cu.index} index={$smarty.section.cu.index}
id={$custid[cu]}<br /> id={$custid[cu]}<br />
{/section} {/section}
]]> ]]>
</programlisting> </programlisting>
<para> <para>
@@ -602,7 +602,7 @@ iteration=6 index=15 id=3015<br />
{section name=co loop=$contacts} {section name=co loop=$contacts}
{if $smarty.section.co.iteration % 5 == 1} {if $smarty.section.co.iteration % 5 == 1}
<tr><th>&nbsp;</th><th>Name></th><th>Home</th><th>Cell</th><th>Email</th></tr> <tr><th>&nbsp;</th><th>Name></th><th>Home</th><th>Cell</th><th>Email</th></tr>
{/if} {/if}
<tr> <tr>
<td><a href="view.php?id={$contacts[co].id}">view<a></td> <td><a href="view.php?id={$contacts[co].id}">view<a></td>
<td>{$contacts[co].name}</td> <td>{$contacts[co].name}</td>
@@ -610,7 +610,7 @@ iteration=6 index=15 id=3015<br />
<td>{$contacts[co].cell}</td> <td>{$contacts[co].cell}</td>
<td>{$contacts[co].email}</td> <td>{$contacts[co].email}</td>
<tr> <tr>
{/section} {/section}
</table> </table>
]]> ]]>
</programlisting> </programlisting>
@@ -646,21 +646,21 @@ iteration=6 index=15 id=3015<br />
<programlisting> <programlisting>
<![CDATA[ <![CDATA[
{section name=customer loop=$customers} {section name=customer loop=$customers}
{if $smarty.section.customer.first} {if $smarty.section.customer.first}
<table> <table>
<tr><th>id</th><th>customer</th></tr> <tr><th>id</th><th>customer</th></tr>
{/if} {/if}
<tr> <tr>
<td>{$customers[customer].id}}</td> <td>{$customers[customer].id}}</td>
<td>{$customers[customer].name}</td> <td>{$customers[customer].name}</td>
</tr> </tr>
{if $smarty.section.customer.last} {if $smarty.section.customer.last}
<tr><td></td><td>{$smarty.section.customer.total} customers</td></tr> <tr><td></td><td>{$smarty.section.customer.total} customers</td></tr>
</table> </table>
{/if} {/if}
{/section} {/section}
]]> ]]>
</programlisting> </programlisting>
</example> </example>
@@ -686,9 +686,9 @@ iteration=6 index=15 id=3015<br />
<title>{section} property index</title> <title>{section} property index</title>
<programlisting> <programlisting>
<![CDATA[ <![CDATA[
{section name=customer loop=$custid} {section name=customer loop=$custid}
{$smarty.section.customer.index} id: {$custid[customer]}<br /> {$smarty.section.customer.index} id: {$custid[customer]}<br />
{/section} {/section}
There were {$smarty.section.customer.loop} customers shown above. There were {$smarty.section.customer.loop} customers shown above.
]]> ]]>
@@ -698,9 +698,9 @@ iteration=6 index=15 id=3015<br />
</para> </para>
<screen> <screen>
<![CDATA[ <![CDATA[
0 id: 1000<br /> 0 id: 1000<br />
1 id: 1001<br /> 1 id: 1001<br />
2 id: 1002<br /> 2 id: 1002<br />
There were 3 customers shown above. There were 3 customers shown above.
]]> ]]>
@@ -723,15 +723,15 @@ iteration=6 index=15 id=3015<br />
$show_customer_info (true/false) may have been passed from the PHP $show_customer_info (true/false) may have been passed from the PHP
application, to regulate whether or not this section shows application, to regulate whether or not this section shows
*} *}
{section name=customer loop=$custid show=$show_customer_info} {section name=customer loop=$custid show=$show_customer_info}
{$smarty.section.customer.rownum} id: {$custid[customer]}<br /> {$smarty.section.customer.rownum} id: {$custid[customer]}<br />
{/section} {/section}
{if $smarty.section.customer.show} {if $smarty.section.customer.show}
the section was shown. the section was shown.
{else} {else}
the section was not shown. the section was not shown.
{/if} {/if}
]]> ]]>
</programlisting> </programlisting>
<para> <para>
@@ -739,11 +739,11 @@ iteration=6 index=15 id=3015<br />
</para> </para>
<screen> <screen>
<![CDATA[ <![CDATA[
1 id: 1000<br /> 1 id: 1000<br />
2 id: 1001<br /> 2 id: 1001<br />
3 id: 1002<br /> 3 id: 1002<br />
the section was shown. the section was shown.
]]> ]]>
</screen> </screen>
</example> </example>
@@ -758,9 +758,9 @@ iteration=6 index=15 id=3015<br />
<title>{section} property total</title> <title>{section} property total</title>
<programlisting> <programlisting>
<![CDATA[ <![CDATA[
{section name=customer loop=$custid step=2} {section name=customer loop=$custid step=2}
{$smarty.section.customer.index} id: {$custid[customer]}<br /> {$smarty.section.customer.index} id: {$custid[customer]}<br />
{/section} {/section}
There were {$smarty.section.customer.total} customers shown above. There were {$smarty.section.customer.total} customers shown above.
]]> ]]>
@@ -770,11 +770,11 @@ iteration=6 index=15 id=3015<br />
</para> </para>
<screen> <screen>
<![CDATA[ <![CDATA[
0 id: 1000<br /> 0 id: 1000<br />
2 id: 1002<br /> 2 id: 1002<br />
4 id: 1004<br /> 4 id: 1004<br />
There were 3 customers shown above. There were 3 customers shown above.
]]> ]]>
</screen> </screen>
</example> </example>