some WS and fixed a typo in the example

This commit is contained in:
didou
2004-04-20 11:20:27 +00:00
parent 876a25fe2c
commit cfdc174a3f

View File

@@ -3,24 +3,31 @@
<sect1 id="language.assigned.variables">
<title>Variables assign<67>es depuis PHP</title>
<para>
Pour utiliser une variables assign<67>es depuis PHP, il faut la pr<70>fixer par le
symbole dollar <literal>$</literal>. Les variables asign<67>es depuis un
template gr<67>ce <20> la fonction <link linkend="language.function.assign">assign</link>
sont manipul<75>es de la m<>me fa<66>on.
Pour utiliser une variables assign<67>es depuis PHP, il
faut la pr<70>fixer par le symbole dollar <literal>$</literal>.
Les variables asign<67>es depuis un template gr<67>ce <20> la fonction
<link linkend="language.function.assign">assign</link> sont
manipul<75>es de la m<>me fa<66>on.
</para>
<example>
<title>Variables assign<67>es</title>
<programlisting>
<![CDATA[
Bienvenue {$prenom}, heureux de voir que tu es arriv<69> ici.
&lt;p&gt;
<p>
La derni<6E>re connexion remonte au {$dateConnexionPrecedente}.
SORTIE:
Bienvenue Doug, heureux de voir que tu est arriv<69> ici.
&lt;p&gt;
La derni<6E>re connexion remonte au 11 janvier 2001.</programlisting>
]]>
</programlisting>
<para>
Cela va afficher:
</para>
<screen>
<![CDATA[
Bienvenue Doug, heureux de voir que tu es arriv<69> ici.
<p>
La derni<6E>re connexion remonte au 11 janvier 2001.
]]>
</screen>
</example>
<sect2 id="language.variables.assoc.arrays">
@@ -31,39 +38,52 @@ La derni
apr<70>s le symbole '.' (point).
</para>
<example>
<title>acc<EFBFBD>der aux variables de tableaux associatifs</title>
<programlisting>
index.php:
<title>Acc<EFBFBD>der aux variables de tableaux associatifs</title>
<programlisting role="php">
<![CDATA[
<?php
$smarty = new Smarty;
$smarty-&gt;assign('Contacts',
$smarty->assign('Contacts',
array('fax' => '555-222-9876',
'email' => 'zaphod@slartibartfast.com',
'phone' => array('home' => '555-444-3333',
'cell' => '555-111-1234')));
$smarty-&gt;display('index.tpl');
index.tpl:
{$Contacts.fax}&lt;br&gt;
{$Contacts.email}&lt;br&gt;
{* you can print arrays of arrays as well *}
{$Contacts.phone.home}&lt;br&gt;
{$Contacts.phone.cell}&lt;br&gt;
SORTIE:
555-222-9876&lt;br&gt;
zaphod@slartibartfast.com&lt;br&gt;
555-444-3333&lt;br&gt;
555-111-1234&lt;br&gt;</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 />
zaphod@slartibartfast.com<br />
555-444-3333<br />
555-111-1234<br />
]]>
</screen>
</example>
</sect2>
<sect2 id="language.variables.array.indexes">
<title>Tableaux index<65>s</title>
<para>
Vous pouvez utiliser des tableaux index<65>s de la m<>me fa<66>on que vous le
faites en PHP.
Vous pouvez utiliser des tableaux index<65>s de la m<>me fa<66>on
que vous le faites en PHP.
</para>
<example>
<title>Acc<EFBFBD>s aux tableaux gr<67>ce <20> l'index</title>