mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 19:04:27 +02:00
sync with EN
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
<!-- $Revision$ -->
|
<!-- $Revision$ -->
|
||||||
<!-- EN-Revision: 1.2 Maintainer: gerald Status: ready -->
|
<!-- EN-Revision: 1.3 Maintainer: gerald Status: ready -->
|
||||||
<sect1 id="language.function.php">
|
<sect1 id="language.function.php">
|
||||||
<title>php</title>
|
<title>php</title>
|
||||||
<para>
|
<para>
|
||||||
@@ -22,6 +22,12 @@
|
|||||||
]]>
|
]]>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</example>
|
</example>
|
||||||
|
<para>
|
||||||
|
Voir aussi
|
||||||
|
<link linkend="language.function.include.php">{include_php}</link>,
|
||||||
|
<link linkend="language.function.include">{include}</link> et
|
||||||
|
<link linkend="tips.componentized.templates">les templates composantes</link>.
|
||||||
|
</para>
|
||||||
</sect1>
|
</sect1>
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
<!-- $Revision$ -->
|
<!-- $Revision$ -->
|
||||||
<!-- EN-Revision: 1.5 Maintainer: gerald Status: ready -->
|
<!-- EN-Revision: 1.6 Maintainer: gerald Status: ready -->
|
||||||
<sect1 id="language.function.section">
|
<sect1 id="language.function.section">
|
||||||
<title>section, sectionelse</title>
|
<title>section, sectionelse</title>
|
||||||
<informaltable frame="all">
|
<informaltable frame="all">
|
||||||
@@ -94,148 +94,176 @@
|
|||||||
</para>
|
</para>
|
||||||
<example>
|
<example>
|
||||||
<title>section</title>
|
<title>section</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{* Cet exemple va afficher toutes les valeurs du tableau $idClient *}
|
{* Cet exemple va afficher toutes les valeurs du tableau $idClient *}
|
||||||
{section name=client loop=$idClient}
|
{section name=client loop=$idClient}
|
||||||
id: {$idClient[client]}<br>
|
id: {$idClient[client]}<br />
|
||||||
{/section}
|
{/section}
|
||||||
|
]]>
|
||||||
SORTIE:
|
</programlisting>
|
||||||
|
<para>
|
||||||
id: 1000<br>
|
L'exemple ci-dessus affichera :
|
||||||
id: 1001<br>
|
</para>
|
||||||
id: 1002<br></programlisting>
|
<screen>
|
||||||
|
<![CDATA[
|
||||||
|
id: 1000<br />
|
||||||
|
id: 1001<br />
|
||||||
|
id: 1002<br />
|
||||||
|
]]>
|
||||||
|
</screen>
|
||||||
</example>
|
</example>
|
||||||
|
|
||||||
<example>
|
<example>
|
||||||
<title>section, variable de parcours</title>
|
<title>section, variable de parcours</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{* La variable de parcours d<>termine uniquement le nombre de fois que nous allons
|
{* La variable de parcours d<>termine uniquement le nombre de fois que nous allons
|
||||||
rentrer dans la boucle. Vous pouvez acc<63>der <20> toutes les variables du template
|
rentrer dans la boucle. Vous pouvez acc<63>der <20> toutes les variables du template
|
||||||
lorsque vous <20>tes dans une section. Cet exemple part du principe que
|
lorsque vous <20>tes dans une section. Cet exemple part du principe que
|
||||||
$idClient, $noms et $adresses sont tous des tableaux qui contiennent
|
$idClient, $noms et $adresses sont tous des tableaux qui contiennent
|
||||||
autant de valeurs les uns que les autres.*}
|
autant de valeurs les uns que les autres.*}
|
||||||
{section name=client loop=$idClient}
|
{section name=client loop=$idClient}
|
||||||
id: {$idClient[client]}<br>
|
id: {$idClient[client]}<br />
|
||||||
nom: {$noms[client]}<br>
|
nom: {$noms[client]}<br />
|
||||||
addresse: {$addresses[client]}<br>
|
addresse: {$addresses[client]}<br />
|
||||||
<p>
|
<p>
|
||||||
{/section}
|
{/section}
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
SORTIE:
|
<para>
|
||||||
|
L'exemple ci-dessus affichera :
|
||||||
id: 1000<br>
|
</para>
|
||||||
nom: John Smith<br>
|
<screen>
|
||||||
addresse: 253 N 45th<br>
|
<![CDATA[
|
||||||
<p>
|
id: 1000<br />
|
||||||
id: 1001<br>
|
nom: John Smith<br />
|
||||||
nom: Jack Jones<br>
|
addresse: 253 N 45th<br />
|
||||||
addresse: 417 Mulberry ln<br>
|
<p>
|
||||||
<p>
|
id: 1001<br />
|
||||||
id: 1002<br>
|
nom: Jack Jones<br />
|
||||||
nom: Jane Munson<br>
|
addresse: 417 Mulberry ln<br />
|
||||||
addresse: 5605 apple st<br>
|
<p>
|
||||||
<p></programlisting>
|
id: 1002<br />
|
||||||
|
nom: Jane Munson<br />
|
||||||
|
addresse: 5605 apple st<br />
|
||||||
|
<p>
|
||||||
|
]]>
|
||||||
|
</screen>
|
||||||
</example>
|
</example>
|
||||||
|
|
||||||
<example>
|
<example>
|
||||||
<title>nom de section</title>
|
<title>nom de section</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{* Le nom de la section peut <20>tre ce que vous voulez,
|
{* Le nom de la section peut <20>tre ce que vous voulez,
|
||||||
et est utilis<69> pour r<>f<EFBFBD>rencer les donn<6E>es depuis la section. *}
|
et est utilis<69> pour r<>f<EFBFBD>rencer les donn<6E>es depuis la section. *}
|
||||||
{section name=monTableau loop=$idClient}
|
{section name=monTableau loop=$idClient}
|
||||||
id: {$idCLient[monTableau]}<br>
|
id: {$idCLient[monTableau]}<br />
|
||||||
name: {$noms[monTableau]}<br>
|
name: {$noms[monTableau]}<br />
|
||||||
address: {$addresses[monTableau]}<br>
|
address: {$addresses[monTableau]}<br />
|
||||||
<p>
|
<p>
|
||||||
{/section}</programlisting>
|
{/section}
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
</example>
|
</example>
|
||||||
|
|
||||||
<example>
|
<example>
|
||||||
<title>sections imbriqu<71>es</title>
|
<title>sections imbriqu<71>es</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{* Les sections peuvent <20>tre imbriqu<71>es <20> un nombre de niveaux illimit<69>.
|
{* Les sections peuvent <20>tre imbriqu<71>es <20> un nombre de niveaux illimit<69>.
|
||||||
Gr<47>ce aux sections imbriqu<71>es, vous pouvez acc<63>der <20> des structures de donn<6E>es
|
Gr<47>ce aux sections imbriqu<71>es, vous pouvez acc<63>der <20> des structures de donn<6E>es
|
||||||
complexes, comme des tableaux multi-dimentionnels. Dans cet exemple,
|
complexes, comme des tableaux multi-dimentionnels. Dans cet exemple,
|
||||||
$type_contact[client] est un tableau de type de contact pour le client
|
$type_contact[client] est un tableau de type de contact pour le client
|
||||||
courant. *}
|
courant. *}
|
||||||
{section name=client loop=$idClient}
|
{section name=client loop=$idClient}
|
||||||
id: {$idClient[client]}<br>
|
id: {$idClient[client]}<br />
|
||||||
nom: {$nom[client]}<br>
|
nom: {$nom[client]}<br />
|
||||||
addresse: {$addresse[client]}<br>
|
addresse: {$addresse[client]}<br />
|
||||||
{section name=contact loop=$type_contact[client]}
|
{section name=contact loop=$type_contact[client]}
|
||||||
{$type_contact[client][contact]}: {$info_contact[client][contact]}<br>
|
{$type_contact[client][contact]}: {$info_contact[client][contact]}<br />
|
||||||
{/section}
|
{/section}
|
||||||
<p>
|
<p>
|
||||||
{/section}
|
{/section}
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
SORTIE:
|
<para>
|
||||||
|
L'exemple ci-dessus affichera :
|
||||||
id: 1000<br>
|
</para>
|
||||||
nom: John Smith<br>
|
<screen>
|
||||||
addresse: 253 N 45th<br>
|
<![CDATA[
|
||||||
telephone: 555-555-5555<br>
|
id: 1000<br />
|
||||||
telephone portable: 555-555-5555<br>
|
nom: John Smith<br />
|
||||||
e-mail: john@myexample.com<br>
|
addresse: 253 N 45th<br />
|
||||||
<p>
|
telephone: 555-555-5555<br />
|
||||||
id: 1001<br>
|
telephone portable: 555-555-5555<br />
|
||||||
nom: Jack Jones<br>
|
e-mail: john@myexample.com<br />
|
||||||
addresse: 417 Mulberry ln<br>
|
<p>
|
||||||
telephone: 555-555-5555<br>
|
id: 1001<br />
|
||||||
telephone portable: 555-555-5555<br>
|
nom: Jack Jones<br />
|
||||||
e-mail: jack@myexample.com<br>
|
addresse: 417 Mulberry ln<br />
|
||||||
<p>
|
telephone: 555-555-5555<br />
|
||||||
id: 1002<br>
|
telephone portable: 555-555-5555<br />
|
||||||
nom: Jane Munson<br>
|
e-mail: jack@myexample.com<br />
|
||||||
addresse: 5605 apple st<br>
|
<p>
|
||||||
telephone: 555-555-5555<br>
|
id: 1002<br />
|
||||||
telephone portable: 555-555-5555<br>
|
nom: Jane Munson<br />
|
||||||
e-mail: jane@myexample.com<br>
|
addresse: 5605 apple st<br />
|
||||||
<p></programlisting>
|
telephone: 555-555-5555<br />
|
||||||
|
telephone portable: 555-555-5555<br />
|
||||||
|
e-mail: jane@myexample.com<br />
|
||||||
|
<p>
|
||||||
|
]]>
|
||||||
|
</screen>
|
||||||
</example>
|
</example>
|
||||||
|
|
||||||
<example>
|
<example>
|
||||||
<title>Sections et tableaux associatifs</title>
|
<title>Sections et tableaux associatifs</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{* Exemple d'affichage d'un tableau associatif dans une section *}
|
{* Exemple d'affichage d'un tableau associatif dans une section *}
|
||||||
{section name=client loop=$contacts}
|
{section name=client loop=$contacts}
|
||||||
nom: {$contacts[client].name}<br>
|
nom: {$contacts[client].name}<br />
|
||||||
telephone: {$contacts[client].home}<br>
|
telephone: {$contacts[client].home}<br />
|
||||||
portable: {$contacts[client].cell}<br>
|
portable: {$contacts[client].cell}<br />
|
||||||
e-mail: {$contacts[client].email}<p>
|
e-mail: {$contacts[client].email}<p>
|
||||||
{/section}
|
{/section}
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
SORTIE:
|
<para>
|
||||||
|
L'exemple ci-dessus affichera :
|
||||||
nom: John Smith<br>
|
</para>
|
||||||
telephone: 555-555-5555<br>
|
<screen>
|
||||||
portable: 555-555-5555<br>
|
<![CDATA[
|
||||||
e-mail: john@myexample.com<p>
|
nom: John Smith<br />
|
||||||
nom: Jack Jones<br>
|
telephone: 555-555-5555<br />
|
||||||
telephone: 555-555-5555<br>
|
portable: 555-555-5555<br />
|
||||||
portable: 555-555-5555<br>
|
e-mail: john@myexample.com<p>
|
||||||
e-mail: jack@myexample.com<p>
|
nom: Jack Jones<br />
|
||||||
nom: Jane Munson<br>
|
telephone: 555-555-5555<br />
|
||||||
telephone: 555-555-5555<br>
|
portable: 555-555-5555<br />
|
||||||
portable: 555-555-5555<br>
|
e-mail: jack@myexample.com<p>
|
||||||
e-mail: jane@myexample.com<p></programlisting>
|
nom: Jane Munson<br />
|
||||||
|
telephone: 555-555-5555<br />
|
||||||
|
portable: 555-555-5555<br />
|
||||||
|
e-mail: jane@myexample.com<p>
|
||||||
|
]]>
|
||||||
|
</screen>
|
||||||
</example>
|
</example>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<example>
|
<example>
|
||||||
<title>sectionelse</title>
|
<title>sectionelse</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{* sectionelse est ex<65>cut<75> s'il n'existe aucune valeur dans idClient *}
|
{* sectionelse est ex<65>cut<75> s'il n'existe aucune valeur dans idClient *}
|
||||||
{section name=client loop=$idClient}
|
{section name=client loop=$idClient}
|
||||||
id: {$idClient[client]}<br>
|
id: {$idClient[client]}<br />
|
||||||
{sectionelse}
|
{sectionelse}
|
||||||
Aucune valeur dans $idClient.
|
Aucune valeur dans $idClient.
|
||||||
{/section}</programlisting>
|
{/section}
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
</example>
|
</example>
|
||||||
<para>
|
<para>
|
||||||
Les sections ont leur propre variable de gestion des propri<72>t<EFBFBD>s.
|
Les sections ont leur propre variable de gestion des propri<72>t<EFBFBD>s.
|
||||||
@@ -266,17 +294,22 @@ e-mail: jane@myexample.com<p></programlisting>
|
|||||||
<example>
|
<example>
|
||||||
<title>propri<EFBFBD>t<EFBFBD> de section index</title>
|
<title>propri<EFBFBD>t<EFBFBD> de section index</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
{section name=client loop=$idClient}
|
<![CDATA[
|
||||||
{$smarty.section.client.index} id: {$idClient[client]}<br>
|
{section name=client loop=$idClient}
|
||||||
{/section}
|
{$smarty.section.client.index} id: {$idClient[client]}<br />
|
||||||
|
{/section}
|
||||||
|
]]>
|
||||||
SORTIE:
|
</programlisting>
|
||||||
|
<para>
|
||||||
0 id: 1000<br>
|
L'exemple ci-dessus affichera :
|
||||||
1 id: 1001<br>
|
</para>
|
||||||
2 id: 1002<br>
|
<screen>
|
||||||
</programlisting>
|
<![CDATA[
|
||||||
|
0 id: 1000<br />
|
||||||
|
1 id: 1001<br />
|
||||||
|
2 id: 1002<br />
|
||||||
|
]]>
|
||||||
|
</screen>
|
||||||
</example>
|
</example>
|
||||||
</sect2>
|
</sect2>
|
||||||
<sect2 id="section.property.index.prev">
|
<sect2 id="section.property.index.prev">
|
||||||
@@ -287,25 +320,30 @@ e-mail: jane@myexample.com<p></programlisting>
|
|||||||
</para>
|
</para>
|
||||||
<example>
|
<example>
|
||||||
<title>propri<EFBFBD>t<EFBFBD> de section index_prev</title>
|
<title>propri<EFBFBD>t<EFBFBD> de section index_prev</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{section name=client loop=$idClient}
|
{section name=client loop=$idClient}
|
||||||
{$smarty.section.client.index} id: {$idClient[client]}<br>
|
{$smarty.section.client.index} id: {$idClient[client]}<br />
|
||||||
{* Pour votre information, $idClient[client.index] and $idClient[client] sont identiques *}
|
{* Pour votre information, $idClient[client.index] and $idClient[client] sont identiques *}
|
||||||
{if $idClient[client.index_prev] ne $idClient[client.index]}
|
{if $idClient[client.index_prev] ne $idClient[client.index]}
|
||||||
L'id du client <20> <20>t<EFBFBD> modifi<66><br>
|
L'id du client <20> <20>t<EFBFBD> modifi<66><br />
|
||||||
{/if}
|
{/if}
|
||||||
{/section}
|
{/section}
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
SORTIE:
|
<para>
|
||||||
|
L'exemple ci-dessus affichera :
|
||||||
0 id: 1000<br>
|
</para>
|
||||||
L'id du client <20> <20>t<EFBFBD> modifi<66><br>
|
<screen>
|
||||||
1 id: 1001<br>
|
<![CDATA[
|
||||||
L'id du client <20> <20>t<EFBFBD> modifi<66><br>
|
0 id: 1000<br />
|
||||||
2 id: 1002<br>
|
L'id du client <20> <20>t<EFBFBD> modifi<66><br />
|
||||||
L'id du client <20> <20>t<EFBFBD> modifi<66><br>
|
1 id: 1001<br />
|
||||||
</programlisting>
|
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 />
|
||||||
|
]]>
|
||||||
|
</screen>
|
||||||
</example>
|
</example>
|
||||||
</sect2>
|
</sect2>
|
||||||
<sect2 id="section.property.index.next">
|
<sect2 id="section.property.index.next">
|
||||||
@@ -317,25 +355,30 @@ e-mail: jane@myexample.com<p></programlisting>
|
|||||||
</para>
|
</para>
|
||||||
<example>
|
<example>
|
||||||
<title>propri<EFBFBD>t<EFBFBD> de section index_next</title>
|
<title>propri<EFBFBD>t<EFBFBD> de section index_next</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{section name=client loop=$idClient}
|
{section name=client loop=$idClient}
|
||||||
{$smarty.section.client.index} id: {$idClient[client]}<br>
|
{$smarty.section.client.index} id: {$idClient[client]}<br />
|
||||||
{* Pour votre information, $idClient[client.index] and $idClient[client] sont identiques *}
|
{* Pour votre information, $idClient[client.index] and $idClient[client] sont identiques *}
|
||||||
{if $idClient[client.index_next] ne $idClient[client.index]}
|
{if $idClient[client.index_next] ne $idClient[client.index]}
|
||||||
L'id du client va changer<br>
|
L'id du client va changer<br />
|
||||||
{/if}
|
{/if}
|
||||||
{/section}
|
{/section}
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
SORTIE:
|
<para>
|
||||||
|
L'exemple ci-dessus affichera :
|
||||||
0 id: 1000<br>
|
</para>
|
||||||
L'id du client va changer<br>
|
<screen>
|
||||||
1 id: 1001<br>
|
<![CDATA[
|
||||||
L'id du client va changer<br>
|
0 id: 1000<br />
|
||||||
2 id: 1002<br>
|
L'id du client va changer<br />
|
||||||
L'id du client va changer<br>
|
1 id: 1001<br />
|
||||||
</programlisting>
|
L'id du client va changer<br />
|
||||||
|
2 id: 1002<br />
|
||||||
|
L'id du client va changer<br />
|
||||||
|
]]>
|
||||||
|
</screen>
|
||||||
</example>
|
</example>
|
||||||
</sect2>
|
</sect2>
|
||||||
<sect2 id="section.property.iteration">
|
<sect2 id="section.property.iteration">
|
||||||
@@ -351,29 +394,34 @@ e-mail: jane@myexample.com<p></programlisting>
|
|||||||
</para>
|
</para>
|
||||||
<example>
|
<example>
|
||||||
<title>propri<EFBFBD>t<EFBFBD> iteration de section</title>
|
<title>propri<EFBFBD>t<EFBFBD> iteration de section</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{section name=client loop=$idClient start=5 step=2}
|
{section name=client loop=$idClient start=5 step=2}
|
||||||
Iteration courante: {$smarty.section.client.iteration}<br>
|
Iteration courante: {$smarty.section.client.iteration}<br />
|
||||||
{$smarty.section.client.index} id: {$idClient[client]}<br>
|
{$smarty.section.client.index} id: {$idClient[client]}<br />
|
||||||
{* Pour votre information, $idClient[client.index] and $idClient[client] sont identiques *}
|
{* Pour votre information, $idClient[client.index] and $idClient[client] sont identiques *}
|
||||||
{if $idCLient[client.index_next] ne $idClient[client.index]}
|
{if $idCLient[client.index_next] ne $idClient[client.index]}
|
||||||
L'id du client va changer<br>
|
L'id du client va changer<br />
|
||||||
{/if}
|
{/if}
|
||||||
{/section}
|
{/section}
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
SORTIE:
|
<para>
|
||||||
|
L'exemple ci-dessus affichera :
|
||||||
|
</para>
|
||||||
|
<screen>
|
||||||
|
<![CDATA[
|
||||||
Iteration courante: 1
|
Iteration courante: 1
|
||||||
5 id: 1000<br>
|
5 id: 1000<br />
|
||||||
L'id du client va changer<br>
|
L'id du client va changer<br />
|
||||||
Iteration courante: 2
|
Iteration courante: 2
|
||||||
7 id: 1001<br>
|
7 id: 1001<br />
|
||||||
L'id du client va changer<br>
|
L'id du client va changer<br />
|
||||||
Iteration courante: 3
|
Iteration courante: 3
|
||||||
9 id: 1002<br>
|
9 id: 1002<br />
|
||||||
L'id du client va changer<br>
|
L'id du client va changer<br />
|
||||||
</programlisting>
|
]]>
|
||||||
|
</screen>
|
||||||
</example>
|
</example>
|
||||||
</sect2>
|
</sect2>
|
||||||
<sect2 id="section.property.first">
|
<sect2 id="section.property.first">
|
||||||
@@ -383,29 +431,34 @@ e-mail: jane@myexample.com<p></programlisting>
|
|||||||
</para>
|
</para>
|
||||||
<example>
|
<example>
|
||||||
<title>propri<EFBFBD>t<EFBFBD> first de la section</title>
|
<title>propri<EFBFBD>t<EFBFBD> first de la section</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{section name=client loop=$idClient}
|
{section name=client loop=$idClient}
|
||||||
{if $smarty.section.client.first}
|
{if $smarty.section.client.first}
|
||||||
<table>
|
<table>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<tr><td>{$smarty.section.client.index} id:
|
<tr><td>{$smarty.section.client.index} id:
|
||||||
{$idClient[client]}</td></tr>
|
{$idClient[client]}</td></tr>
|
||||||
|
|
||||||
{if $smarty.section.client.last}
|
{if $smarty.section.client.last}
|
||||||
</table>
|
</table>
|
||||||
{/if}
|
{/if}
|
||||||
{/section}
|
{/section}
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
SORTIE:
|
<para>
|
||||||
|
L'exemple ci-dessus affichera :
|
||||||
<table>
|
</para>
|
||||||
<tr><td>0 id: 1000</td></tr>
|
<screen>
|
||||||
<tr><td>1 id: 1001</td></tr>
|
<![CDATA[
|
||||||
<tr><td>2 id: 1002</td></tr>
|
<table>
|
||||||
</table>
|
<tr><td>0 id: 1000</td></tr>
|
||||||
</programlisting>
|
<tr><td>1 id: 1001</td></tr>
|
||||||
|
<tr><td>2 id: 1002</td></tr>
|
||||||
|
</table>
|
||||||
|
]]>
|
||||||
|
</screen>
|
||||||
</example>
|
</example>
|
||||||
</sect2>
|
</sect2>
|
||||||
<sect2 id="section.property.last">
|
<sect2 id="section.property.last">
|
||||||
@@ -415,29 +468,34 @@ e-mail: jane@myexample.com<p></programlisting>
|
|||||||
</para>
|
</para>
|
||||||
<example>
|
<example>
|
||||||
<title>Propri<EFBFBD>t<EFBFBD> last de section</title>
|
<title>Propri<EFBFBD>t<EFBFBD> last de section</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{section name=client loop=$idClient}
|
{section name=client loop=$idClient}
|
||||||
{if $smarty.section.client.first}
|
{if $smarty.section.client.first}
|
||||||
<table>
|
<table>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<tr><td>{$smarty.section.client.index} id:
|
<tr><td>{$smarty.section.client.index} id:
|
||||||
{$idClient[client]}</td></tr>
|
{$idClient[client]}</td></tr>
|
||||||
|
|
||||||
{if $smarty.section.client.last}
|
{if $smarty.section.client.last}
|
||||||
</table>
|
</table>
|
||||||
{/if}
|
{/if}
|
||||||
{/section}
|
{/section}
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
SORTIE:
|
<para>
|
||||||
|
L'exemple ci-dessus affichera :
|
||||||
<table>
|
</para>
|
||||||
<tr><td>0 id: 1000</td></tr>
|
<screen>
|
||||||
<tr><td>1 id: 1001</td></tr>
|
<![CDATA[
|
||||||
<tr><td>2 id: 1002</td></tr>
|
<table>
|
||||||
</table>
|
<tr><td>0 id: 1000</td></tr>
|
||||||
</programlisting>
|
<tr><td>1 id: 1001</td></tr>
|
||||||
|
<tr><td>2 id: 1002</td></tr>
|
||||||
|
</table>
|
||||||
|
]]>
|
||||||
|
</screen>
|
||||||
</example>
|
</example>
|
||||||
</sect2>
|
</sect2>
|
||||||
<sect2 id="section.property.rownum">
|
<sect2 id="section.property.rownum">
|
||||||
@@ -450,17 +508,22 @@ e-mail: jane@myexample.com<p></programlisting>
|
|||||||
<example>
|
<example>
|
||||||
<title>propri<EFBFBD>t<EFBFBD> rownum de section</title>
|
<title>propri<EFBFBD>t<EFBFBD> rownum de section</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{section name=client loop=$idClient}
|
{section name=client loop=$idClient}
|
||||||
{$smarty.section.client.rownum} id: {$idClient[client]}<br>
|
{$smarty.section.client.rownum} id: {$idClient[client]}<br />
|
||||||
{/section}
|
{/section}
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
SORTIE:
|
<para>
|
||||||
|
L'exemple ci-dessus affichera :
|
||||||
1 id: 1000<br>
|
</para>
|
||||||
2 id: 1001<br>
|
<screen>
|
||||||
3 id: 1002<br>
|
<![CDATA[
|
||||||
</programlisting>
|
1 id: 1000<br />
|
||||||
|
2 id: 1001<br />
|
||||||
|
3 id: 1002<br />
|
||||||
|
]]>
|
||||||
|
</screen>
|
||||||
</example>
|
</example>
|
||||||
</sect2>
|
</sect2>
|
||||||
<sect2 id="section.property.loop">
|
<sect2 id="section.property.loop">
|
||||||
@@ -472,20 +535,26 @@ e-mail: jane@myexample.com<p></programlisting>
|
|||||||
<example>
|
<example>
|
||||||
<title>Propri<EFBFBD>t<EFBFBD> de section index</title>
|
<title>Propri<EFBFBD>t<EFBFBD> de section index</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{section name=client loop=$idClient}
|
{section name=client loop=$idClient}
|
||||||
{$smarty.section.client.index} id: {$idClient[client]}<br>
|
{$smarty.section.client.index} id: {$idClient[client]}<br />
|
||||||
{/section}
|
{/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:
|
</programlisting>
|
||||||
|
<para>
|
||||||
0 id: 1000<br>
|
L'exemple ci-dessus affichera :
|
||||||
1 id: 1001<br>
|
</para>
|
||||||
2 id: 1002<br>
|
<screen>
|
||||||
|
<![CDATA[
|
||||||
|
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>
|
]]>
|
||||||
|
</screen>
|
||||||
</example>
|
</example>
|
||||||
</sect2>
|
</sect2>
|
||||||
<sect2 id="section.property.show">
|
<sect2 id="section.property.show">
|
||||||
@@ -498,11 +567,12 @@ e-mail: jane@myexample.com<p></programlisting>
|
|||||||
</para>
|
</para>
|
||||||
<example>
|
<example>
|
||||||
<title>section, attribut show</title>
|
<title>section, attribut show</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{* $show_client_info a pu <20>tre pass<73> par le script PHP,
|
{* $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 *}
|
pour d<>terminer si oui ou non on souhaite afficher la section *}
|
||||||
{section name=client loop=$idClient show=$show_client_info}
|
{section name=client loop=$idClient show=$show_client_info}
|
||||||
{$smarty.section.client.rownum} id: {$idClient[client]}<br>
|
{$smarty.section.client.rownum} id: {$idClient[client]}<br />
|
||||||
{/section}
|
{/section}
|
||||||
|
|
||||||
{if $smarty.section.client.show}
|
{if $smarty.section.client.show}
|
||||||
@@ -510,16 +580,20 @@ e-mail: jane@myexample.com<p></programlisting>
|
|||||||
{else}
|
{else}
|
||||||
la section n'a pas <20>t<EFBFBD> affich<63>e.
|
la section n'a pas <20>t<EFBFBD> affich<63>e.
|
||||||
{/if}
|
{/if}
|
||||||
|
]]>
|
||||||
|
</programlisting>
|
||||||
SORTIE:
|
<para>
|
||||||
|
L'exemple ci-dessus affichera :
|
||||||
1 id: 1000<br>
|
</para>
|
||||||
2 id: 1001<br>
|
<screen>
|
||||||
3 id: 1002<br>
|
<![CDATA[
|
||||||
|
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>
|
]]>
|
||||||
|
</screen>
|
||||||
</example>
|
</example>
|
||||||
</sect2>
|
</sect2>
|
||||||
<sect2 id="section.property.total">
|
<sect2 id="section.property.total">
|
||||||
@@ -530,21 +604,27 @@ e-mail: jane@myexample.com<p></programlisting>
|
|||||||
</para>
|
</para>
|
||||||
<example>
|
<example>
|
||||||
<title>section, propri<72>t<EFBFBD> total</title>
|
<title>section, propri<72>t<EFBFBD> total</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
<![CDATA[
|
||||||
{section name=client loop=$idClient step=2}
|
{section name=client loop=$idClient step=2}
|
||||||
{$smarty.section.client.index} id: {$idClient[client]}<br>
|
{$smarty.section.client.index} id: {$idClient[client]}<br />
|
||||||
{/section}
|
{/section}
|
||||||
|
|
||||||
Il y eu {$smarty.section.client.total} clients affich<63>s.
|
Il y eu {$smarty.section.client.total} clients affich<63>s.
|
||||||
|
]]>
|
||||||
SORTIE:
|
</programlisting>
|
||||||
|
<para>
|
||||||
0 id: 1000<br>
|
L'exemple ci-dessus affichera :
|
||||||
2 id: 1001<br>
|
</para>
|
||||||
4 id: 1002<br>
|
<screen>
|
||||||
|
<![CDATA[
|
||||||
|
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>
|
]]>
|
||||||
|
</screen>
|
||||||
</example>
|
</example>
|
||||||
</sect2>
|
</sect2>
|
||||||
</sect1>
|
</sect1>
|
||||||
|
Reference in New Issue
Block a user