cvs: smarty /docs/fr/designers/language-variables language-assigned-variables.xml
"Mehdi Achour" <[email protected]>
| Newsgroups | gmane.comp.php.cvs.smarty |
|---|---|
| Message-ID | <cvsdidou1082460027@cvsserver> |
didou Tue Apr 20 07:20:27 2004 EDT
Modified files:
/smarty/docs/fr/designers/language-variables
language-assigned-variables.xml
Log:
some WS and fixed a typo in the example
http://cvs.php.net/diff.php/smarty/docs/fr/designers/language-variables/language-assigned-variables.xml?r1=1.1&r2=1.2&ty=u
Index: smarty/docs/fr/designers/language-variables/language-assigned-variables.xml
diff -u smarty/docs/fr/designers/language-variables/language-assigned-variables.xml:1.1 smarty/docs/fr/designers/language-variables/language-assigned-variables.xml:1.2
--- smarty/docs/fr/designers/language-variables/language-assigned-variables.xml:1.1 Tue Apr 13 11:43:47 2004
+++ smarty/docs/fr/designers/language-variables/language-assigned-variables.xml Tue Apr 20 07:20:27 2004
@@ -1,73 +1,93 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.1 $ -->
- <sect1 id="language.assigned.variables">
- <title>Variables assignées depuis PHP</title>
- <para>
- Pour utiliser une variables assignées depuis PHP, il faut la préfixer par le
- symbole dollar <literal>$</literal>. Les variables asignées depuis un
- template grâce à la fonction <link linkend="language.function.assign">assign</link>
- sont manipulées de la même façon.
- </para>
- <example>
-
- <title>Variables assignées</title>
-<programlisting>
+<!-- $Revision: 1.2 $ -->
+<sect1 id="language.assigned.variables">
+ <title>Variables assignées depuis PHP</title>
+ <para>
+ Pour utiliser une variables assignées depuis PHP, il
+ faut la préfixer par le symbole dollar <literal>$</literal>.
+ Les variables asignées depuis un template grâce à la fonction
+ <link linkend="language.function.assign">assign</link> sont
+ manipulées de la même façon.
+ </para>
+ <example>
+ <title>Variables assignées</title>
+ <programlisting>
+<![CDATA[
Bienvenue {$prenom}, heureux de voir que tu es arrivé ici.
-<p>
+<p>
La dernière connexion remonte au {$dateConnexionPrecedente}.
-
-SORTIE:
-
-Bienvenue Doug, heureux de voir que tu est arrivé ici.
-<p>
-La dernière connexion remonte au 11 janvier 2001.</programlisting>
-</example>
-
- <sect2 id="language.variables.assoc.arrays">
- <title>Tableaux associatifs</title>
- <para>
- Vous pouvez également utiliser des variables sous forme de tableaux
- associatifs assignées depuis PHP en en spécifiant la clef,
- après le symbole '.' (point).
- </para>
-<example>
-<title>accéder aux variables de tableaux associatifs</title>
-<programlisting>
-index.php:
+]]>
+ </programlisting>
+ <para>
+ Cela va afficher:
+ </para>
+ <screen>
+<![CDATA[
+Bienvenue Doug, heureux de voir que tu es arrivé ici.
+<p>
+La dernière connexion remonte au 11 janvier 2001.
+]]>
+ </screen>
+ </example>
+
+ <sect2 id="language.variables.assoc.arrays">
+ <title>Tableaux associatifs</title>
+ <para>
+ Vous pouvez également utiliser des variables sous forme de tableaux
+ associatifs assignées depuis PHP en en spécifiant la clef,
+ après le symbole '.' (point).
+ </para>
+ <example>
+ <title>Accéder aux variables de tableaux associatifs</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
$smarty = new Smarty;
-$smarty->assign('Contacts',
+$smarty->assign('Contacts',
array('fax' => '555-222-9876',
'email' => '[email protected]',
'phone' => array('home' => '555-444-3333',
'cell' => '555-111-1234')));
-$smarty->display('index.tpl');
-
-index.tpl:
-
-{$Contacts.fax}<br>
-{$Contacts.email}<br>
-{* you can print arrays of arrays as well *}
-{$Contacts.phone.home}<br>
-{$Contacts.phone.cell}<br>
-
-SORTIE:
-
-555-222-9876<br>
[email protected]<br>
-555-444-3333<br>
-555-111-1234<br></programlisting>
-</example>
- </sect2>
- <sect2 id="language.variables.array.indexes">
- <title>Tableaux indexés</title>
- <para>
- Vous pouvez utiliser des tableaux indexés de la même façon que vous le
- faites en PHP.
- </para>
-<example>
-<title>Accès aux tableaux grâce à l'index</title>
-<programlisting>
+$smarty->display('index.tpl');
+?>
+]]>
+ </programlisting>
+ <para>
+ où index.tpl est :
+ </para>
+ <programlisting>
+<![CDATA[
+{$Contacts.fax}<br />
+{$Contacts.email}<br />
+{* vous pouvez afficher des tableaux de tableaux *}
+{$Contacts.phone.home}<br />
+{$Contacts.phone.cell}<br />
+]]>
+ </programlisting>
+ <para>
+ Cela va afficher :
+ </para>
+ <screen>
+<![CDATA[
+555-222-9876<br />
[email protected]<br />
+555-444-3333<br />
+555-111-1234<br />
+]]>
+ </screen>
+ </example>
+ </sect2>
+
+ <sect2 id="language.variables.array.indexes">
+ <title>Tableaux indexés</title>
+ <para>
+ Vous pouvez utiliser des tableaux indexés de la même façon
+ que vous le faites en PHP.
+ </para>
+ <example>
+ <title>Accès aux tableaux grâce à l'index</title>
+ <programlisting>
index.php:
$smarty = new Smarty;
@@ -93,13 +113,13 @@
555-444-3333<br>
555-111-1234<br></programlisting>
</example>
- </sect2>
+ </sect2>
<sect2 id="language.variables.objects">
- <title>Objets</title>
- <para>
- Les attributs des objets assignés depuis PHP peuvent être utilisées en
- en spécifiant le nom après le symbole '->'.
- </para>
+ <title>Objets</title>
+ <para>
+ Les attributs des objets assignés depuis PHP peuvent être utilisées en
+ en spécifiant le nom après le symbole '->'.
+ </para>
<example>
<title>accéder aux attributs des objets</title>
<programlisting>
@@ -111,7 +131,7 @@
nom: Zaphod Beeblebrox<br>
email: [email protected]<br></programlisting>
</example>
- </sect2>
+ </sect2>
</sect1>
<!-- Keep this comment at the end of the file
Local variables:
@@ -132,4 +152,4 @@
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
--->
\ No newline at end of file
+-->
--
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php