@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<!-- EN - Revision: 1.3 Maintainer: gerald Status: ready -->
<!-- EN - Revision: 1.5 Maintainer: gerald Status: ready -->
<sect1 id= "language.function.section" >
<title > section,sectionelse</title>
<title > section, sectionelse</title>
<informaltable frame= "all" >
<tgroup cols= "5" >
<colspec colname= "param" align= "center" />
@@ -29,12 +29,10 @@
</row>
<row >
<entry > loop</entry>
<entry > [$nom_variable] </entry>
<entry > mixed </entry>
<entry > Oui</entry>
<entry > <emphasis > n/a</emphasis> </entry>
<entry > le nom de la variable qui d<> termine le nombre de
fois que la boucle sera ex<65> cut<75> e.
</entry>
<entry > valeur qui d<> termine le nombre de fois que la boucle sera ex<65> cut<75> e.</entry>
</row>
<row >
<entry > start</entry>
@@ -164,13 +162,13 @@ addresse: 5605 apple st<br>
$type_contact[client] est un tableau de type de contact pour le client
courant. *}
{section name=client loop=$idClient}
id: {$idClient[client]}< br>
nom: {$nom[client]}< br>
addresse: {$addresse[client]}< br>
{section name=contact loop=$type_contact[client]}
{$type_contact[client][contact]}: {$info_contact[client][contact]}< br>
{/section}
< p>
id: {$idClient[client]}< br>
nom: {$nom[client]}< br>
addresse: {$addresse[client]}< br>
{section name=contact loop=$type_contact[client]}
{$type_contact[client][contact]}: {$info_contact[client][contact]}< br>
{/section}
< p>
{/section}
@@ -181,21 +179,21 @@ nom: John Smith<br>
addresse: 253 N 45th< br>
telephone: 555-555-5555< br>
telephone portable: 555-555-5555< br>
e-mail: john@mydomain .com< br>
e-mail: john@myexample .com< br>
< p>
id: 1001< br>
nom: Jack Jones< br>
addresse: 417 Mulberry ln< br>
telephone: 555-555-5555< br>
telephone portable: 555-555-5555< br>
e-mail: jack@mydomain .com< br>
e-mail: jack@myexample .com< br>
< p>
id: 1002< br>
nom: Jane Munson< br>
addresse: 5605 apple st< br>
telephone: 555-555-5555< br>
telephone portable: 555-555-5555< br>
e-mail: jane@mydomain .com< br>
e-mail: jane@myexample .com< br>
< p> </programlisting>
</example>
@@ -204,10 +202,10 @@ e-mail: jane@mydomain.com<br>
<programlisting >
{* Exemple d'affichage d'un tableau associatif dans une section *}
{section name=client loop=$contacts}
nom: {$contacts[client].name}< br>
telephone: {$contacts[client].home}< br>
portable: {$contacts[client].cell}< br>
e-mail: {$contacts[client].email}< p>
nom: {$contacts[client].name}< br>
telephone: {$contacts[client].home}< br>
portable: {$contacts[client].cell}< br>
e-mail: {$contacts[client].email}< p>
{/section}
@@ -216,15 +214,15 @@ SORTIE:
nom: John Smith< br>
telephone: 555-555-5555< br>
portable: 555-555-5555< br>
e-mail: john@mydomain .com< p>
e-mail: john@myexample .com< p>
nom: Jack Jones< br>
telephone: 555-555-5555< br>
portable: 555-555-5555< br>
e-mail: jack@mydomain .com< p>
e-mail: jack@myexample .com< p>
nom: Jane Munson< br>
telephone: 555-555-5555< br>
portable: 555-555-5555< br>
e-mail: jane@mydomain .com< p> </programlisting>
e-mail: jane@myexample .com< p> </programlisting>
</example>
@@ -234,9 +232,9 @@ e-mail: jane@mydomain.com<p></programlisting>
<programlisting >
{* sectionelse est ex<65> cut<75> s'il n'existe aucune valeur dans idClient *}
{section name=client loop=$idClient}
id: {$idClient[client]}< br>
id: {$idClient[client]}< br>
{sectionelse}
Aucune valeur dans $idClient.
Aucune valeur dans $idClient.
{/section}</programlisting>
</example>
<para >
@@ -268,16 +266,16 @@ e-mail: jane@mydomain.com<p></programlisting>
<example >
<title > propri<EFBFBD> t<EFBFBD> de section index</title>
<programlisting >
{section name=client loop=$idClient}
{$smarty.section.client.index} id: {$idClient[client]}< br>
{/section}
{section name=client loop=$idClient}
{$smarty.section.client.index} id: {$idClient[client]}< br>
{/section}
SORTIE:
SORTIE:
0 id: 1000< br>
1 id: 1001< br>
2 id: 1002< br>
0 id: 1000< br>
1 id: 1001< br>
2 id: 1002< br>
</programlisting>
</example>
</sect2>
@@ -290,23 +288,23 @@ e-mail: jane@mydomain.com<p></programlisting>
<example >
<title > propri<EFBFBD> t<EFBFBD> de section index_prev</title>
<programlisting >
{section name=client loop=$idClient}
{$smarty.section.client.index} id: {$idClient[client]}< br>
{* Pour votre information, $idClient[client.index] and $idClient[client] sont identiques *}
{if $idClient[client.index_prev] ne $idClient[client.index]}
L'id du client <20> <20> t<EFBFBD> modifi<66> < br>
{/if}
{/section}
{section name=client loop=$idClient}
{$smarty.section.client.index} id: {$idClient[client]}< br>
{* Pour votre information, $idClient[client.index] and $idClient[client] sont identiques *}
{if $idClient[client.index_prev] ne $idClient[client.index]}
L'id du client <20> <20> t<EFBFBD> modifi<66> < br>
{/if}
{/section}
SORTIE:
SORTIE:
0 id: 1000< br>
L'id du client <20> <20> t<EFBFBD> modifi<66> < br>
1 id: 1001< br>
L'id du client <20> <20> t<EFBFBD> modifi<66> < br>
2 id: 1002< br>
L'id du client <20> <20> t<EFBFBD> modifi<66> < br>
0 id: 1000< br>
L'id du client <20> <20> t<EFBFBD> modifi<66> < br>
1 id: 1001< br>
L'id du client <20> <20> t<EFBFBD> modifi<66> < br>
2 id: 1002< br>
L'id du client <20> <20> t<EFBFBD> modifi<66> < br>
</programlisting>
</example>
</sect2>
@@ -320,23 +318,23 @@ e-mail: jane@mydomain.com<p></programlisting>
<example >
<title > propri<EFBFBD> t<EFBFBD> de section index_next</title>
<programlisting >
{section name=client loop=$idClient}
{$smarty.section.client.index} id: {$idClient[client]}< br>
{* Pour votre information, $idClient[client.index] and $idClient[client] sont identiques *}
{if $idClient[client.index_next] ne $idClient[client.index]}
L'id du client va changer< br>
{/if}
{/section}
{section name=client loop=$idClient}
{$smarty.section.client.index} id: {$idClient[client]}< br>
{* Pour votre information, $idClient[client.index] and $idClient[client] sont identiques *}
{if $idClient[client.index_next] ne $idClient[client.index]}
L'id du client va changer< br>
{/if}
{/section}
SORTIE:
SORTIE:
0 id: 1000< br>
L'id du client va changer< br>
1 id: 1001< br>
L'id du client va changer< br>
2 id: 1002< br>
L'id du client va changer< br>
0 id: 1000< br>
L'id du client va changer< br>
1 id: 1001< br>
L'id du client va changer< br>
2 id: 1002< br>
L'id du client va changer< br>
</programlisting>
</example>
</sect2>
@@ -354,27 +352,27 @@ e-mail: jane@mydomain.com<p></programlisting>
<example >
<title > propri<EFBFBD> t<EFBFBD> iteration de section</title>
<programlisting >
{section name=client loop=$idClient start=5 step=2}
Iteration courante: {$smarty.section.client.iteration}< br>
{$smarty.section.client.index} id: {$idClient[client]}< br>
{* Pour votre information, $idClient[client.index] and $idClient[client] sont identiques *}
{if $idCLient[client.index_next] ne $idClient[client.index]}
L'id du client va changer< br>
{/if}
{/section}
{section name=client loop=$idClient start=5 step=2}
Iteration courante: {$smarty.section.client.iteration}< br>
{$smarty.section.client.index} id: {$idClient[client]}< br>
{* Pour votre information, $idClient[client.index] and $idClient[client] sont identiques *}
{if $idCLient[client.index_next] ne $idClient[client.index]}
L'id du client va changer< br>
{/if}
{/section}
SORTIE:
SORTIE:
Iteration courante: 1
5 id: 1000< br>
L'id du client va changer< br>
Iteration courante: 2
7 id: 1001< br>
L'id du client va changer< br>
Iteration courante: 3
9 id: 1002< br>
L'id du client va changer< br>
Iteration courante: 1
5 id: 1000< br>
L'id du client va changer< br>
Iteration courante: 2
7 id: 1001< br>
L'id du client va changer< br>
Iteration courante: 3
9 id: 1002< br>
L'id du client va changer< br>
</programlisting>
</example>
</sect2>
@@ -386,27 +384,27 @@ e-mail: jane@mydomain.com<p></programlisting>
<example >
<title > propri<EFBFBD> t<EFBFBD> first de la section</title>
<programlisting >
{section name=client loop=$idClient}
{if $smarty.section.client.first}
< table>
{/if}
{section name=client loop=$idClient}
{if $smarty.section.client.first}
< table>
{/if}
< tr> < td> {$smarty.section.client.index} id:
{$idClient[client]}< /td> < /tr>
< tr> < td> {$smarty.section.client.index} id:
{$idClient[client]}< /td> < /tr>
{if $smarty.section.client.last}
< /table>
{/if}
{/section}
{if $smarty.section.client.last}
< /table>
{/if}
{/section}
SORTIE:
SORTIE:
< table>
< tr> < td> 0 id: 1000< /td> < /tr>
< tr> < td> 1 id: 1001< /td> < /tr>
< tr> < td> 2 id: 1002< /td> < /tr>
< /table>
< table>
< tr> < td> 0 id: 1000< /td> < /tr>
< tr> < td> 1 id: 1001< /td> < /tr>
< tr> < td> 2 id: 1002< /td> < /tr>
< /table>
</programlisting>
</example>
</sect2>
@@ -418,27 +416,27 @@ e-mail: jane@mydomain.com<p></programlisting>
<example >
<title > Propri<EFBFBD> t<EFBFBD> last de section</title>
<programlisting >
{section name=client loop=$idClient}
{if $smarty.section.client.first}
< table>
{/if}
{section name=client loop=$idClient}
{if $smarty.section.client.first}
< table>
{/if}
< tr> < td> {$smarty.section.client.index} id:
{$idClient[client]}< /td> < /tr>
< tr> < td> {$smarty.section.client.index} id:
{$idClient[client]}< /td> < /tr>
{if $smarty.section.client.last}
< /table>
{/if}
{/section}
{if $smarty.section.client.last}
< /table>
{/if}
{/section}
SORTIE:
SORTIE:
< table>
< tr> < td> 0 id: 1000< /td> < /tr>
< tr> < td> 1 id: 1001< /td> < /tr>
< tr> < td> 2 id: 1002< /td> < /tr>
< /table>
< table>
< tr> < td> 0 id: 1000< /td> < /tr>
< tr> < td> 1 id: 1001< /td> < /tr>
< tr> < td> 2 id: 1002< /td> < /tr>
< /table>
</programlisting>
</example>
</sect2>
@@ -452,16 +450,16 @@ e-mail: jane@mydomain.com<p></programlisting>
<example >
<title > propri<EFBFBD> t<EFBFBD> rownum de section</title>
<programlisting >
{section name=client loop=$idClient}
{$smarty.section.client.rownum} id: {$idClient[client]}< br>
{/section}
{section name=client loop=$idClient}
{$smarty.section.client.rownum} id: {$idClient[client]}< br>
{/section}
SORTIE:
SORTIE:
1 id: 1000< br>
2 id: 1001< br>
3 id: 1002< br>
1 id: 1000< br>
2 id: 1001< br>
3 id: 1002< br>
</programlisting>
</example>
</sect2>
@@ -474,19 +472,19 @@ e-mail: jane@mydomain.com<p></programlisting>
<example >
<title > Propri<EFBFBD> t<EFBFBD> de section index</title>
<programlisting >
{section name=client loop=$idClient}
{$smarty.section.client.index} id: {$idClient[client]}< br>
{/section}
{section name=client loop=$idClient}
{$smarty.section.client.index} id: {$idClient[client]}< br>
{/section}
Il y eu {$smarty.section.client.loop} clients d'affich<63> s.
Il y eu {$smarty.section.client.loop} clients d'affich<63> s.
SORTIE:
SORTIE:
0 id: 1000< br>
1 id: 1001< br>
2 id: 1002< br>
0 id: 1000< br>
1 id: 1001< br>
2 id: 1002< br>
il y eu 3 clients d'affich<63> s.
il y eu 3 clients d'affich<63> s.
</programlisting>
</example>
</sect2>
@@ -501,26 +499,26 @@ e-mail: jane@mydomain.com<p></programlisting>
<example >
<title > section, attribut show</title>
<programlisting >
{* $show_client_info a pu <20> tre pass<73> par le script PHP,
pour d<> terminer si oui ou non on souhaite afficher la section *}
{section name=client loop=$idClient show=$show_client_info}
{$smarty.section.client.rownum} id: {$idClient[client]}< br>
{/section}
{* $show_client_info a pu <20> tre pass<73> par le script PHP,
pour d<> terminer si oui ou non on souhaite afficher la section *}
{section name=client loop=$idClient show=$show_client_info}
{$smarty.section.client.rownum} id: {$idClient[client]}< br>
{/section}
{if $smarty.section.client.show}
la section <20> <20> t<EFBFBD> affich<63> e.
{else}
la section n'a pas <20> t<EFBFBD> affich<63> e.
{/if}
{if $smarty.section.client.show}
la section <20> <20> t<EFBFBD> affich<63> e.
{else}
la section n'a pas <20> t<EFBFBD> affich<63> e.
{/if}
SORTIE:
SORTIE:
1 id: 1000< br>
2 id: 1001< br>
3 id: 1002< br>
1 id: 1000< br>
2 id: 1001< br>
3 id: 1002< br>
la section <20> <20> t<EFBFBD> affich<63> e.
la section <20> <20> t<EFBFBD> affich<63> e.
</programlisting>
</example>
</sect2>
@@ -533,19 +531,19 @@ e-mail: jane@mydomain.com<p></programlisting>
<example >
<title > section, propri<72> t<EFBFBD> total</title>
<programlisting >
{section name=client loop=$idClient step=2}
{$smarty.section.client.index} id: {$idClient[client]}< br>
{/section}
{section name=client loop=$idClient step=2}
{$smarty.section.client.index} id: {$idClient[client]}< br>
{/section}
Il y eu {$smarty.section.client.total} clients affich<63> s.
Il y eu {$smarty.section.client.total} clients affich<63> s.
SORTIE:
SORTIE:
0 id: 1000< br>
2 id: 1001< br>
4 id: 1002< br>
0 id: 1000< br>
2 id: 1001< br>
4 id: 1002< br>
Il y eu 3 clients affich<63> s.
Il y eu 3 clients affich<63> s.
</programlisting>
</example>
</sect2>