cvs: smarty /docs/fr/designers/language-builtin-functions language-function-php.xml language-function-section.xml
"Yannick Torres" <[email protected]>
| Newsgroups | gmane.comp.php.cvs.smarty |
|---|---|
| Message-ID | <cvsyannick1115761013@cvsserver> |
yannick Tue May 10 17:36:53 2005 EDT
Modified files:
/smarty/docs/fr/designers/language-builtin-functions
language-function-php.xml
language-function-section.xml
Log:
sync with EN
--
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
yannick-20050510173653.txt
(text/plain, 18.6 KB)
http://cvs.php.net/diff.php/smarty/docs/fr/designers/language-builtin-functions/language-function-php.xml?r1=1.4&r2=1.5&ty=u
Index: smarty/docs/fr/designers/language-builtin-functions/language-function-php.xml
diff -u smarty/docs/fr/designers/language-builtin-functions/language-function-php.xml:1.4 smarty/docs/fr/designers/language-builtin-functions/language-function-php.xml:1.5
--- smarty/docs/fr/designers/language-builtin-functions/language-function-php.xml:1.4 Tue May 10 17:15:40 2005
+++ smarty/docs/fr/designers/language-builtin-functions/language-function-php.xml Tue May 10 17:36:53 2005
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.4 $ -->
-<!-- EN-Revision: 1.2 Maintainer: gerald Status: ready -->
+<!-- $Revision: 1.5 $ -->
+<!-- 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:
http://cvs.php.net/diff.php/smarty/docs/fr/designers/language-builtin-functions/language-function-section.xml?r1=1.6&r2=1.7&ty=u
Index: smarty/docs/fr/designers/language-builtin-functions/language-function-section.xml
diff -u smarty/docs/fr/designers/language-builtin-functions/language-function-section.xml:1.6 smarty/docs/fr/designers/language-builtin-functions/language-function-section.xml:1.7
--- smarty/docs/fr/designers/language-builtin-functions/language-function-section.xml:1.6 Sun Dec 26 16:12:44 2004
+++ smarty/docs/fr/designers/language-builtin-functions/language-function-section.xml Tue May 10 17:36:53 2005
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.6 $ -->
-<!-- EN-Revision: 1.5 Maintainer: gerald Status: ready -->
+<!-- $Revision: 1.7 $ -->
+<!-- EN-Revision: 1.6 Maintainer: gerald Status: ready -->
<sect1 id="language.function.section">
<title>section, sectionelse</title>
<informaltable frame="all">
@@ -94,148 +94,176 @@
</para>
<example>
<title>section</title>
-<programlisting>
-
+ <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>
+ <programlisting>
+<![CDATA[
{* La variable de parcours détermine uniquement le nombre de fois que nous allons
rentrer dans la boucle. Vous pouvez accéder à toutes les variables du template
lorsque vous ê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>
+ <programlisting>
+<![CDATA[
{* Le nom de la section peut être ce que vous voulez,
et est utilisé pour référencer les donné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ées</title>
-<programlisting>
+ <programlisting>
+<![CDATA[
{* Les sections peuvent être imbriquées à un nombre de niveaux illimité.
Grâce aux sections imbriquées, vous pouvez accéder à des structures de donné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: [email protected]<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: [email protected]<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: [email protected]<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: [email protected]<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: [email protected]<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: [email protected]<br />
+<p>
+]]>
+ </screen>
</example>
-
+
<example>
<title>Sections et tableaux associatifs</title>
-<programlisting>
+ <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: [email protected]<p>
-nom: Jack Jones<br>
-telephone: 555-555-5555<br>
-portable: 555-555-5555<br>
-e-mail: [email protected]<p>
-nom: Jane Munson<br>
-telephone: 555-555-5555<br>
-portable: 555-555-5555<br>
-e-mail: [email protected]<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: [email protected]<p>
+nom: Jack Jones<br />
+telephone: 555-555-5555<br />
+portable: 555-555-5555<br />
+e-mail: [email protected]<p>
+nom: Jane Munson<br />
+telephone: 555-555-5555<br />
+portable: 555-555-5555<br />
+e-mail: [email protected]<p>
+]]>
+ </screen>
</example>
-
-
-
+
<example>
<title>sectionelse</title>
-<programlisting>
+ <programlisting>
+<![CDATA[
{* sectionelse est exécuté 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étés.
@@ -266,17 +294,22 @@
<example>
<title>propriété de section index</title>
<programlisting>
- {section name=client loop=$idClient}
- {$smarty.section.client.index} id: {$idClient[client]}<br>
- {/section}
-
-
- SORTIE:
-
- 0 id: 1000<br>
- 1 id: 1001<br>
- 2 id: 1002<br>
-</programlisting>
+<![CDATA[
+{section name=client loop=$idClient}
+{$smarty.section.client.index} id: {$idClient[client]}<br />
+{/section}
+]]>
+ </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">
@@ -287,25 +320,30 @@
</para>
<example>
<title>propriété de section index_prev</title>
-<programlisting>
+ <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 à été modifié<br>
+ L'id du client à été modifié<br />
{/if}
{/section}
-
-
- SORTIE:
-
- 0 id: 1000<br>
- L'id du client à été modifié<br>
- 1 id: 1001<br>
- L'id du client à été modifié<br>
- 2 id: 1002<br>
- L'id du client à été modifié<br>
-</programlisting>
+]]>
+ </programlisting>
+ <para>
+ L'exemple ci-dessus affichera :
+ </para>
+ <screen>
+<![CDATA[
+ 0 id: 1000<br />
+ L'id du client à été modifié<br />
+ 1 id: 1001<br />
+ L'id du client à été modifié<br />
+ 2 id: 1002<br />
+ L'id du client à été modifié<br />
+]]>
+ </screen>
</example>
</sect2>
<sect2 id="section.property.index.next">
@@ -317,25 +355,30 @@
</para>
<example>
<title>propriété de section index_next</title>
-<programlisting>
+ <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>
+]]>
+ </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">
@@ -351,29 +394,34 @@
</para>
<example>
<title>propriété iteration de section</title>
-<programlisting>
+ <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:
-
+]]>
+ </programlisting>
+ <para>
+ L'exemple ci-dessus affichera :
+ </para>
+ <screen>
+<![CDATA[
Iteration courante: 1
- 5 id: 1000<br>
- L'id du client va changer<br>
+ 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>
+ 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>
+ 9 id: 1002<br />
+ L'id du client va changer<br />
+]]>
+ </screen>
</example>
</sect2>
<sect2 id="section.property.first">
@@ -383,29 +431,34 @@
</para>
<example>
<title>propriété first de la section</title>
-<programlisting>
+ <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>
+]]>
+ </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">
@@ -415,29 +468,34 @@
</para>
<example>
<title>Propriété last de section</title>
-<programlisting>
+ <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>
+]]>
+ </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 @@
<example>
<title>propriété 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>
+]]>
+ </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 @@
<example>
<title>Propriété 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é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és.
-</programlisting>
+]]>
+ </screen>
</example>
</sect2>
<sect2 id="section.property.show">
@@ -498,11 +567,12 @@
</para>
<example>
<title>section, attribut show</title>
-<programlisting>
+ <programlisting>
+<![CDATA[
{* $show_client_info a pu être passé 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 @@
{else}
la section n'a pas été affiché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 à été affichée.
-</programlisting>
+]]>
+ </screen>
</example>
</sect2>
<sect2 id="section.property.total">
@@ -530,21 +604,27 @@
</para>
<example>
<title>section, propriété total</title>
-<programlisting>
+ <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é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és.
-</programlisting>
+]]>
+ </screen>
</example>
</sect2>
</sect1>