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,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.7 Maintainer: gerald Status: ready -->
|
||||
<sect1 id="language.function.capture">
|
||||
<title>capture</title>
|
||||
<title>{capture}</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -38,13 +38,13 @@
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Capture est utilis<69> pour r<>cup<75>rer la sortie d'<27>l<EFBFBD>ments dans une variable
|
||||
{capture} est utilis<69> pour r<>cup<75>rer la sortie d'<27>l<EFBFBD>ments dans une variable
|
||||
au lieu de les afficher. Tout contenu situ<74> entre {capture
|
||||
name="foo"} et {/capture} est intercept<70> dans une variable dont le nom est
|
||||
sp<73>cifi<66> dans l'attribut name. Le contenu captur<75> peut <20>tre utilis<69> dans
|
||||
le template par l'interm<72>diaire de la variable sp<73>ciale <link
|
||||
linkend="language.variables.smarty.capture">$smarty.capture.foo</link>
|
||||
ou foo est la valeur de l'attribut name. Si vous ne donnez pas de valeur
|
||||
o<EFBFBD> "foo" est la valeur de l'attribut name. Si vous ne donnez pas de valeur
|
||||
<20> l'attribut name, alors "default" est utilis<69>. Toutes les commandes
|
||||
{capture} doivent <20>tre utilis<69>es de paire avec {/capture}. Vous pouvez
|
||||
imbriquer les demandes de captures.
|
||||
@@ -61,9 +61,10 @@
|
||||
<caution>
|
||||
<para>
|
||||
Fa<46>tes attention lorsque vous interceptez la sortie de commandes <link
|
||||
linkend="language.function.insert"><command>insert</command></link>.
|
||||
linkend="language.function.insert">{insert}</link>.
|
||||
Si vous avez configur<75> le <link linkend="caching">cache</link> pour que ce
|
||||
dernier soit actif, et que vous avez des commandes <command>insert</command>
|
||||
dernier soit actif, et que vous avez des commandes <link
|
||||
linkend="language.function.insert">{insert}</link>
|
||||
suppos<6F>es s'ex<65>cuter dans un contenu en cache, ne tentez pas de capturer
|
||||
ce contenu.
|
||||
</para>
|
||||
@@ -78,11 +79,13 @@
|
||||
{include file="get_banner.tpl"}
|
||||
{/capture}
|
||||
{if $smarty.capture.banner ne ""}
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
{$smarty.capture.banner}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{/if}
|
||||
]]>
|
||||
</programlisting>
|
||||
|
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.7 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.8 Maintainer: gerald Status: ready -->
|
||||
<sect1 id="language.function.config.load">
|
||||
<title>config_load</title>
|
||||
<title>{config_load}</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -66,12 +66,13 @@
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Cette fonction est utilise<73> pour charger des variables de fichier
|
||||
{config_load} est utilise<73> pour charger des variables <link
|
||||
linkend="language.config.variables">#variables#</link>
|
||||
de configuration dans un template. Voir <link linkend="config.files">
|
||||
Fichiers de configuration</link> pour de plus amples informations.
|
||||
</para>
|
||||
<example>
|
||||
<title>fonction config_load</title>
|
||||
<title>fonction {config_load}</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{config_load file="colors.conf"}
|
||||
@@ -129,10 +130,12 @@
|
||||
Voir aussi
|
||||
<link linkend="config.files">les fichiers de configuration</link>,
|
||||
<link linkend="language.config.variables">les variables de configuration</link>,
|
||||
<link linkend="variable.config.dir">$config_dir</link>,
|
||||
<link linkend="api.get.config.vars">get_config_vars()</link> et
|
||||
<link linkend="api.config.load">config_load()</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
@@ -1,8 +1,8 @@
|
||||
<?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.foreach">
|
||||
<title>foreach,foreachelse</title>
|
||||
<title>{foreach},{foreachelse}</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -55,8 +55,8 @@
|
||||
<para>
|
||||
Les boucles <emphasis>{foreach}</emphasis> sont une alternative aux boucles
|
||||
<link linkend="language.function.section"><emphasis>section</emphasis></link>.
|
||||
Les boucles <emphasis>foreach</emphasis>
|
||||
sont utilis<69>es pour parcourir des tableaux associatifs simples.
|
||||
Les boucles <emphasis>{foreach}</emphasis>
|
||||
sont utilis<69>es pour parcourir des <emphasis role="bold">tableaux associatifs simples</emphasis>.
|
||||
La syntaxe des boucles <emphasis>{foreach}</emphasis> est bien plus simple
|
||||
que celle des boucles <emphasis>{section}</emphasis>, mais en contrepartie,
|
||||
<emphasis role="bold">elles ne peuvent <20>tre utilis<69>es que pour des tableaux associatifs
|
||||
@@ -74,6 +74,14 @@
|
||||
</para>
|
||||
<example>
|
||||
<title>foreach</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$arr = array( 1001,1002,1003);
|
||||
$smarty->assign('custid', $arr);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* Cet exemple affiche toutes les valeurs du tableau $custid *}
|
||||
@@ -97,17 +105,24 @@ id: 1002<br />
|
||||
|
||||
<example>
|
||||
<title>foreach key</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
// key contient la clef de chaque <20>l<EFBFBD>ment parcouru
|
||||
// L'assignement ressemble <20> ceci :
|
||||
<?php
|
||||
$smarty->assign("contacts", array(
|
||||
array("phone" => "1",
|
||||
"fax" => "2",
|
||||
"cell" => "3"),
|
||||
array("phone" => "555-4444",
|
||||
"fax" => "555-3333",
|
||||
"cell" => "760-1234"))
|
||||
);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* key contient la clef de chaque <20>l<EFBFBD>ment parcouru
|
||||
|
||||
l'attribution des <20>l<EFBFBD>ment est de la forme:
|
||||
|
||||
$smarty->assign("contacts", array(array("tel" => "1", "fax" => "2", "portable" => "3"),
|
||||
array("tel" => "555-4444", "fax" => "555-3333", "portable" => "760-1234")));
|
||||
|
||||
*}
|
||||
|
||||
{foreach name=outer item=contact from=$contacts}
|
||||
{foreach key=key item=item from=$contact}
|
||||
{$key}: {$item}<br />
|
||||
@@ -130,9 +145,29 @@ portable: 760-1234<br />
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>{foreach} - Exemple avec une base de donn<6E>es (eg PEAR ou ADODB)</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$sql = 'select contact_id, name, nick from contacts order by contact';
|
||||
$smarty->assign("contacts", $db->getAssoc($sql));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{foreach key=cid item=con from=$contacts}
|
||||
<a href="contact.php?contact_id={$cid}">{$con.name} - {$con.nick}</a><br />
|
||||
{/foreach}
|
||||
]]>
|
||||
</programlisting>
|
||||
|
||||
</example>
|
||||
|
||||
<para>
|
||||
Les boucles Foreach ont <20>galement leurs propres variables qui g<>rent les propri<72>t<EFBFBD>s
|
||||
de foreach. Elles sont indiqu<71>es par :
|
||||
Les boucles {foreach} ont <20>galement leurs propres variables qui g<>rent les propri<72>t<EFBFBD>s
|
||||
de {foreach}. Elles sont indiqu<71>es par :
|
||||
<link linkend="language.variables.smarty.loops">{$smarty.foreach.foreachname.varname}</link>
|
||||
o<> foreachname est le nom sp<73>cifi<66> par l'attribut <emphasis>name</emphasis>
|
||||
de foreach.
|
||||
@@ -142,8 +177,6 @@ portable: 760-1234<br />
|
||||
<title>iteration</title>
|
||||
<para>
|
||||
<emphasis>iteration</emphasis> est utilis<69> pour afficher l'it<69>ration de la boucle courante.
|
||||
</para>
|
||||
<para>
|
||||
<emphasis>iteration</emphasis> commence toujours par 1 et est incr<63>ment<6E>
|
||||
<20> chaque it<69>ration.
|
||||
</para>
|
||||
@@ -186,6 +219,7 @@ portable: 760-1234<br />
|
||||
</para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.3 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: gerald Status: ready -->
|
||||
<sect1 id="language.function.if">
|
||||
<title>if,elseif,else</title>
|
||||
<title>{if},{elseif},{else}</title>
|
||||
<para>
|
||||
L'instruction <emphasis>{if}</emphasis> dans Smarty dispose de la m<>me flexibilit<69> que l'instruction
|
||||
PHP du m<>me nom, avec quelques fonctionnalit<69>s suppl<70>mentaires pour le
|
||||
@@ -206,6 +206,7 @@
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
@@ -1,8 +1,8 @@
|
||||
<?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.include.php">
|
||||
<title>include_php</title>
|
||||
<title>{include_php}</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -137,9 +137,10 @@
|
||||
<link linkend="language.function.php">{php}</link>,
|
||||
<link linkend="language.function.capture">{capture}</link>, les
|
||||
<link linkend="template.resources">ressources de template</link> et les
|
||||
<link linkend="tips.componentized.templates">"composants templates"</link>
|
||||
<link linkend="tips.componentized.templates">"composants templates"</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
@@ -1,8 +1,8 @@
|
||||
<?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.include">
|
||||
<title>include</title>
|
||||
<title>{include}</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -116,6 +116,7 @@
|
||||
<link linkend="tips.componentized.templates">les templates composants</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.3 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: gerald Status: ready -->
|
||||
<sect1 id="language.function.insert">
|
||||
<title>insert</title>
|
||||
<title>{insert}</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -125,6 +125,7 @@
|
||||
</para>
|
||||
</note>
|
||||
</sect1>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.7 Maintainer: gerald Status: ready -->
|
||||
<sect1 id="language.function.ldelim">
|
||||
<title>ldelim,rdelim</title>
|
||||
<title>{ldelim},{rdelim}</title>
|
||||
<para>
|
||||
ldelim et rdelim sont utilis<69>s pour afficher les d<>limiteurs en tant
|
||||
que tels, dans notre cas, "{" ou "}". Vous pouvez toujours utiliser <link
|
||||
@@ -33,6 +33,7 @@
|
||||
<link linkend="language.escaping">d<EFBFBD>sactivation l'analyse de Smarty</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.6 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.7 Maintainer: gerald Status: ready -->
|
||||
<sect1 id="language.function.literal">
|
||||
<title>literal</title>
|
||||
<title>{literal}</title>
|
||||
<para>
|
||||
Les balises "{literal}" permettent <20> un bloc de donn<6E>es d'<27>tre pris tel
|
||||
quel, sans qu'il ne soit interpr<70>t<EFBFBD> par Smarty. Tr<54>s pratique lors
|
||||
|
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.4 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.5 Maintainer: gerald Status: ready -->
|
||||
<sect1 id="language.function.php">
|
||||
<title>php</title>
|
||||
<title>{php}</title>
|
||||
<para>
|
||||
Les balises {php} permettent de rajouter du code PHP directement dans le
|
||||
template. Ils ne seront pas ignor<6F>s, quelle que soit la valeur de <link
|
||||
@@ -30,6 +30,7 @@
|
||||
<link linkend="tips.componentized.templates">les templates composantes</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
@@ -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 -->
|
||||
<chapter id="language.combining.modifiers">
|
||||
<title>Combiner des modificateurs de variable.</title>
|
||||
<para>
|
||||
@@ -14,16 +14,14 @@
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('titreArticle', 'Les fumeurs sont productifs, mais la mort
|
||||
tue l\'efficacit<69>e.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
<filename>index.tpl</filename> <20>tant :
|
||||
O<EFBFBD> le template est :
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
@@ -49,6 +47,7 @@ L e s f u m e u r s s. . .
|
||||
</screen>
|
||||
</example>
|
||||
</chapter>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<!-- EN-Revision: 1.17 Maintainer: gerald Status: ready -->
|
||||
<!-- EN-Revision: 1.18 Maintainer: gerald Status: ready -->
|
||||
<chapter id="language.modifiers">
|
||||
<title>Modificateurs de variables</title>
|
||||
<para>
|
||||
@@ -73,8 +73,8 @@
|
||||
et <link linkend="plugins.modifiers">les modifieurs</link>.
|
||||
</para>
|
||||
|
||||
&designers.language-modifiers.language-modifier-cat;
|
||||
&designers.language-modifiers.language-modifier-capitalize;
|
||||
&designers.language-modifiers.language-modifier-cat;
|
||||
&designers.language-modifiers.language-modifier-count-characters;
|
||||
&designers.language-modifiers.language-modifier-count-paragraphs;
|
||||
&designers.language-modifiers.language-modifier-count-sentences;
|
||||
|
Reference in New Issue
Block a user