mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 10:54:27 +02:00
sync with EN
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.2 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.3 Maintainer: gerald Status: ready -->
|
||||
<sect1 id="language.function.php">
|
||||
<title>php</title>
|
||||
<para>
|
||||
@@ -22,6 +22,12 @@
|
||||
]]>
|
||||
</programlisting>
|
||||
</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>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.5 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: gerald Status: ready -->
|
||||
<sect1 id="language.function.section">
|
||||
<title>section, sectionelse</title>
|
||||
<informaltable frame="all">
|
||||
@@ -95,147 +95,175 @@
|
||||
<example>
|
||||
<title>section</title>
|
||||
<programlisting>
|
||||
|
||||
<![CDATA[
|
||||
{* Cet exemple va afficher toutes les valeurs du tableau $idClient *}
|
||||
{section name=client loop=$idClient}
|
||||
id: {$idClient[client]}<br>
|
||||
id: {$idClient[client]}<br />
|
||||
{/section}
|
||||
|
||||
SORTIE:
|
||||
|
||||
id: 1000<br>
|
||||
id: 1001<br>
|
||||
id: 1002<br></programlisting>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
L'exemple ci-dessus affichera :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
id: 1000<br />
|
||||
id: 1001<br />
|
||||
id: 1002<br />
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>section, variable de parcours</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* 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
|
||||
lorsque vous <20>tes dans une section. Cet exemple part du principe que
|
||||
$idClient, $noms et $adresses sont tous des tableaux qui contiennent
|
||||
autant de valeurs les uns que les autres.*}
|
||||
{section name=client loop=$idClient}
|
||||
id: {$idClient[client]}<br>
|
||||
nom: {$noms[client]}<br>
|
||||
addresse: {$addresses[client]}<br>
|
||||
<p>
|
||||
id: {$idClient[client]}<br />
|
||||
nom: {$noms[client]}<br />
|
||||
addresse: {$addresses[client]}<br />
|
||||
<p>
|
||||
{/section}
|
||||
|
||||
|
||||
SORTIE:
|
||||
|
||||
id: 1000<br>
|
||||
nom: John Smith<br>
|
||||
addresse: 253 N 45th<br>
|
||||
<p>
|
||||
id: 1001<br>
|
||||
nom: Jack Jones<br>
|
||||
addresse: 417 Mulberry ln<br>
|
||||
<p>
|
||||
id: 1002<br>
|
||||
nom: Jane Munson<br>
|
||||
addresse: 5605 apple st<br>
|
||||
<p></programlisting>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
L'exemple ci-dessus affichera :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
id: 1000<br />
|
||||
nom: John Smith<br />
|
||||
addresse: 253 N 45th<br />
|
||||
<p>
|
||||
id: 1001<br />
|
||||
nom: Jack Jones<br />
|
||||
addresse: 417 Mulberry ln<br />
|
||||
<p>
|
||||
id: 1002<br />
|
||||
nom: Jane Munson<br />
|
||||
addresse: 5605 apple st<br />
|
||||
<p>
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>nom de section</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* 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. *}
|
||||
{section name=monTableau loop=$idClient}
|
||||
id: {$idCLient[monTableau]}<br>
|
||||
name: {$noms[monTableau]}<br>
|
||||
address: {$addresses[monTableau]}<br>
|
||||
<p>
|
||||
{/section}</programlisting>
|
||||
id: {$idCLient[monTableau]}<br />
|
||||
name: {$noms[monTableau]}<br />
|
||||
address: {$addresses[monTableau]}<br />
|
||||
<p>
|
||||
{/section}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>sections imbriqu<71>es</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* 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
|
||||
complexes, comme des tableaux multi-dimentionnels. Dans cet exemple,
|
||||
$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>
|
||||
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>
|
||||
{$type_contact[client][contact]}: {$info_contact[client][contact]}<br />
|
||||
{/section}
|
||||
<p>
|
||||
<p>
|
||||
{/section}
|
||||
|
||||
|
||||
SORTIE:
|
||||
|
||||
id: 1000<br>
|
||||
nom: John Smith<br>
|
||||
addresse: 253 N 45th<br>
|
||||
telephone: 555-555-5555<br>
|
||||
telephone portable: 555-555-5555<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@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@myexample.com<br>
|
||||
<p></programlisting>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
L'exemple ci-dessus affichera :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
id: 1000<br />
|
||||
nom: John Smith<br />
|
||||
addresse: 253 N 45th<br />
|
||||
telephone: 555-555-5555<br />
|
||||
telephone portable: 555-555-5555<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@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@myexample.com<br />
|
||||
<p>
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>Sections et tableaux associatifs</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* 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}
|
||||
|
||||
|
||||
SORTIE:
|
||||
|
||||
nom: John Smith<br>
|
||||
telephone: 555-555-5555<br>
|
||||
portable: 555-555-5555<br>
|
||||
e-mail: john@myexample.com<p>
|
||||
nom: Jack Jones<br>
|
||||
telephone: 555-555-5555<br>
|
||||
portable: 555-555-5555<br>
|
||||
e-mail: jack@myexample.com<p>
|
||||
nom: Jane Munson<br>
|
||||
telephone: 555-555-5555<br>
|
||||
portable: 555-555-5555<br>
|
||||
e-mail: jane@myexample.com<p></programlisting>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
L'exemple ci-dessus affichera :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
nom: John Smith<br />
|
||||
telephone: 555-555-5555<br />
|
||||
portable: 555-555-5555<br />
|
||||
e-mail: john@myexample.com<p>
|
||||
nom: Jack Jones<br />
|
||||
telephone: 555-555-5555<br />
|
||||
portable: 555-555-5555<br />
|
||||
e-mail: jack@myexample.com<p>
|
||||
nom: Jane Munson<br />
|
||||
telephone: 555-555-5555<br />
|
||||
portable: 555-555-5555<br />
|
||||
e-mail: jane@myexample.com<p>
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
|
||||
|
||||
<example>
|
||||
<title>sectionelse</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* 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.
|
||||
{/section}</programlisting>
|
||||
{/section}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
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>
|
||||
<title>propri<EFBFBD>t<EFBFBD> de section index</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{section name=client loop=$idClient}
|
||||
{$smarty.section.client.index} id: {$idClient[client]}<br>
|
||||
{$smarty.section.client.index} id: {$idClient[client]}<br />
|
||||
{/section}
|
||||
|
||||
|
||||
SORTIE:
|
||||
|
||||
0 id: 1000<br>
|
||||
1 id: 1001<br>
|
||||
2 id: 1002<br>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
L'exemple ci-dessus affichera :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
0 id: 1000<br />
|
||||
1 id: 1001<br />
|
||||
2 id: 1002<br />
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.index.prev">
|
||||
@@ -288,24 +321,29 @@ e-mail: jane@myexample.com<p></programlisting>
|
||||
<example>
|
||||
<title>propri<EFBFBD>t<EFBFBD> de section index_prev</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{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 *}
|
||||
{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}
|
||||
{/section}
|
||||
|
||||
|
||||
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>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
L'exemple ci-dessus affichera :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
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 />
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.index.next">
|
||||
@@ -318,24 +356,29 @@ e-mail: jane@myexample.com<p></programlisting>
|
||||
<example>
|
||||
<title>propri<EFBFBD>t<EFBFBD> de section index_next</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{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 *}
|
||||
{if $idClient[client.index_next] ne $idClient[client.index]}
|
||||
L'id du client va changer<br>
|
||||
L'id du client va changer<br />
|
||||
{/if}
|
||||
{/section}
|
||||
|
||||
|
||||
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>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
L'exemple ci-dessus affichera :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
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 />
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.iteration">
|
||||
@@ -352,28 +395,33 @@ e-mail: jane@myexample.com<p></programlisting>
|
||||
<example>
|
||||
<title>propri<EFBFBD>t<EFBFBD> iteration de section</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{section name=client loop=$idClient start=5 step=2}
|
||||
Iteration courante: {$smarty.section.client.iteration}<br>
|
||||
{$smarty.section.client.index} id: {$idClient[client]}<br>
|
||||
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>
|
||||
L'id du client va changer<br />
|
||||
{/if}
|
||||
{/section}
|
||||
|
||||
|
||||
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>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
L'exemple ci-dessus affichera :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
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 />
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.first">
|
||||
@@ -384,28 +432,33 @@ e-mail: jane@myexample.com<p></programlisting>
|
||||
<example>
|
||||
<title>propri<EFBFBD>t<EFBFBD> first de la section</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{section name=client loop=$idClient}
|
||||
{if $smarty.section.client.first}
|
||||
<table>
|
||||
<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>
|
||||
</table>
|
||||
{/if}
|
||||
{/section}
|
||||
|
||||
|
||||
SORTIE:
|
||||
|
||||
<table>
|
||||
<tr><td>0 id: 1000</td></tr>
|
||||
<tr><td>1 id: 1001</td></tr>
|
||||
<tr><td>2 id: 1002</td></tr>
|
||||
</table>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
L'exemple ci-dessus affichera :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
<table>
|
||||
<tr><td>0 id: 1000</td></tr>
|
||||
<tr><td>1 id: 1001</td></tr>
|
||||
<tr><td>2 id: 1002</td></tr>
|
||||
</table>
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.last">
|
||||
@@ -416,28 +469,33 @@ e-mail: jane@myexample.com<p></programlisting>
|
||||
<example>
|
||||
<title>Propri<EFBFBD>t<EFBFBD> last de section</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{section name=client loop=$idClient}
|
||||
{if $smarty.section.client.first}
|
||||
<table>
|
||||
<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>
|
||||
</table>
|
||||
{/if}
|
||||
{/section}
|
||||
|
||||
|
||||
SORTIE:
|
||||
|
||||
<table>
|
||||
<tr><td>0 id: 1000</td></tr>
|
||||
<tr><td>1 id: 1001</td></tr>
|
||||
<tr><td>2 id: 1002</td></tr>
|
||||
</table>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
L'exemple ci-dessus affichera :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
<table>
|
||||
<tr><td>0 id: 1000</td></tr>
|
||||
<tr><td>1 id: 1001</td></tr>
|
||||
<tr><td>2 id: 1002</td></tr>
|
||||
</table>
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.rownum">
|
||||
@@ -450,17 +508,22 @@ e-mail: jane@myexample.com<p></programlisting>
|
||||
<example>
|
||||
<title>propri<EFBFBD>t<EFBFBD> rownum de section</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{section name=client loop=$idClient}
|
||||
{$smarty.section.client.rownum} id: {$idClient[client]}<br>
|
||||
{$smarty.section.client.rownum} id: {$idClient[client]}<br />
|
||||
{/section}
|
||||
|
||||
|
||||
SORTIE:
|
||||
|
||||
1 id: 1000<br>
|
||||
2 id: 1001<br>
|
||||
3 id: 1002<br>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
L'exemple ci-dessus affichera :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
1 id: 1000<br />
|
||||
2 id: 1001<br />
|
||||
3 id: 1002<br />
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.loop">
|
||||
@@ -472,20 +535,26 @@ e-mail: jane@myexample.com<p></programlisting>
|
||||
<example>
|
||||
<title>Propri<EFBFBD>t<EFBFBD> de section index</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{section name=client loop=$idClient}
|
||||
{$smarty.section.client.index} id: {$idClient[client]}<br>
|
||||
{$smarty.section.client.index} id: {$idClient[client]}<br />
|
||||
{/section}
|
||||
|
||||
Il y eu {$smarty.section.client.loop} clients d'affich<63>s.
|
||||
|
||||
SORTIE:
|
||||
|
||||
0 id: 1000<br>
|
||||
1 id: 1001<br>
|
||||
2 id: 1002<br>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
L'exemple ci-dessus affichera :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
0 id: 1000<br />
|
||||
1 id: 1001<br />
|
||||
2 id: 1002<br />
|
||||
|
||||
il y eu 3 clients d'affich<63>s.
|
||||
</programlisting>
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.show">
|
||||
@@ -499,10 +568,11 @@ e-mail: jane@myexample.com<p></programlisting>
|
||||
<example>
|
||||
<title>section, attribut show</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* $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>
|
||||
{$smarty.section.client.rownum} id: {$idClient[client]}<br />
|
||||
{/section}
|
||||
|
||||
{if $smarty.section.client.show}
|
||||
@@ -510,16 +580,20 @@ e-mail: jane@myexample.com<p></programlisting>
|
||||
{else}
|
||||
la section n'a pas <20>t<EFBFBD> affich<63>e.
|
||||
{/if}
|
||||
|
||||
|
||||
SORTIE:
|
||||
|
||||
1 id: 1000<br>
|
||||
2 id: 1001<br>
|
||||
3 id: 1002<br>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
L'exemple ci-dessus affichera :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
1 id: 1000<br />
|
||||
2 id: 1001<br />
|
||||
3 id: 1002<br />
|
||||
|
||||
la section <20> <20>t<EFBFBD> affich<63>e.
|
||||
</programlisting>
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.total">
|
||||
@@ -531,20 +605,26 @@ e-mail: jane@myexample.com<p></programlisting>
|
||||
<example>
|
||||
<title>section, propri<72>t<EFBFBD> total</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{section name=client loop=$idClient step=2}
|
||||
{$smarty.section.client.index} id: {$idClient[client]}<br>
|
||||
{$smarty.section.client.index} id: {$idClient[client]}<br />
|
||||
{/section}
|
||||
|
||||
Il y eu {$smarty.section.client.total} clients affich<63>s.
|
||||
|
||||
SORTIE:
|
||||
|
||||
0 id: 1000<br>
|
||||
2 id: 1001<br>
|
||||
4 id: 1002<br>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
L'exemple ci-dessus affichera :
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
0 id: 1000<br />
|
||||
2 id: 1001<br />
|
||||
4 id: 1002<br />
|
||||
|
||||
Il y eu 3 clients affich<63>s.
|
||||
</programlisting>
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
Reference in New Issue
Block a user