mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
missed files
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.syntax.attributes">
|
||||
<title>Param<EFBFBD>tres</title>
|
||||
<para>
|
||||
La plupart des fonctions attendent des param<61>tres qui r<>gissent leur
|
||||
comportement. Les param<61>tres des fonctions Smarty sont tr<74>s proches des
|
||||
attributs des balises HTML. Les valeurs num<75>riques n'ont pas besoin d'<27>tre
|
||||
entour<75>es par des guillemets, par contre, ces guillemets sont recommand<6E>es lors
|
||||
de l'utilisation de cha<68>nes de caract<63>res. Des variables peuvent aussi <20>tre
|
||||
utilis<69>es en tant que param<61>tres, et ne doivent pas <20>tre entour<75>es de guillemets.
|
||||
</para>
|
||||
<para>
|
||||
Certains param<61>tres requi<75>rent des valeurs bool<6F>ennes (true / false).
|
||||
Elles peuvent <20>tre sp<73>cifi<66>es par l'une des valeures suivantes, sans
|
||||
guillemet: <literal>true</literal>, <literal>on</literal>, et <literal>yes</literal>,
|
||||
ou <literal>false</literal>, <literal>off</literal>, et <literal>no</literal>.
|
||||
</para>
|
||||
<example>
|
||||
<title>Param<EFBFBD>tres de fonction, syntaxe</title>
|
||||
<programlisting>
|
||||
{include file="header.tpl"}
|
||||
|
||||
{include file=$includeFile}
|
||||
|
||||
{include file=#includeFile#}
|
||||
|
||||
{html_select_date display_days=yes}
|
||||
|
||||
<SELECT name=company>
|
||||
{html_options values=$vals selected=$selected output=$output}
|
||||
</SELECT></programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.syntax.comments">
|
||||
<title>Commentaires</title>
|
||||
<para>
|
||||
Les commentaires dans Smarty sont entour<75>s d'asterisques, de cette
|
||||
fa<66>on : {* voici un commentaire *}
|
||||
Les commentaires Smarty ne sont pas affich<63>s dans la sortie finale du
|
||||
template.
|
||||
Ils sont utilis<69>s pour des notes internes, dans le template, pour aider
|
||||
les d<>veloppeurs <20> en comprendre le fonctionnement.
|
||||
</para>
|
||||
<example>
|
||||
<title>Commentaires</title>
|
||||
<programlisting>
|
||||
{* Smarty *}
|
||||
|
||||
{* Inclusion de l'en t<>te *}
|
||||
{include file="header.tpl"}
|
||||
|
||||
{include file=$includeFile}
|
||||
|
||||
{include file=#includeFile#}
|
||||
|
||||
{* affiche des listes d<>roulantes *}
|
||||
<SELECT name=company>
|
||||
{html_options values=$vals selected=$selected output=$output}
|
||||
</SELECT></programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.syntax.functions">
|
||||
<title>Fonctions</title>
|
||||
<para>
|
||||
Les balises Smarty affichent une <link linkend="language.variables">variable</link>
|
||||
ou invoquent une fonction. Les fonctions sont appel<65>es
|
||||
lorsqu'elles sont entour<75>es, ainsi que leurs param<61>tres, des d<>limiteurs Smarty.
|
||||
Par exemple : {nomfonction par1="val" par2="val"}.
|
||||
</para>
|
||||
<example>
|
||||
<title>syntaxe des fonctions</title>
|
||||
<programlisting>
|
||||
{config_load file="colors.conf"}
|
||||
|
||||
{include file="header.tpl"}
|
||||
|
||||
{if $name eq "Fred"}
|
||||
Vous <20>tes admis dans cette zone
|
||||
{else}
|
||||
Bienvenue, <font color="{#fontColor#}">{$name}!</font>
|
||||
{/if}
|
||||
|
||||
{include file="footer.tpl"}</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Les fonctions natives et les fonctions utilisateurs ont toutes deux la m<>me
|
||||
syntaxe, dans les templates. Les fonctions natives sont relatives
|
||||
au traitement interne de Smarty, comme par exemple <command>if</command>,
|
||||
<command>section</command> et <command>strip</command>. Elles ne peuvent
|
||||
<20>tre modifi<66>es. Les fonctions utilisateurs sont des fonctions additionnelles,
|
||||
impl<70>ment<6E>es par l'interm<72>diaire de plugins.
|
||||
Elles peuvent <20>tre modifi<66>es pour correspondre <20> vos besoins, et vous
|
||||
pouvez en cr<63>er de nouvelles. <command>html_options</command> et
|
||||
<command>html_select_date</command> sont deux exemples de fonctions
|
||||
utilisateurs.
|
||||
</para>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.syntax.quotes">
|
||||
<title>Variables ins<6E>r<EFBFBD>es dans des cha<68>nes de caract<63>res</title>
|
||||
<para>
|
||||
Smarty est capable d'interpr<70>ter les variables ins<6E>r<EFBFBD>es <20> l'int<6E>rieur de
|
||||
cha<68>nes entre guillemets, du moment que leur nom est exclusivement compos<6F>
|
||||
de chiffres, lettres, underscores et crochets. Si le nom de la variable
|
||||
contient tout autre caract<63>re (point, r<>f<EFBFBD>rence <20> un objet, etc.)
|
||||
la variable doit <20>tre entour<75>e d'apostrophes inverses (`).
|
||||
</para>
|
||||
<example>
|
||||
<title>Syntaxe d'insertion de variables dans des cha<68>nes</title>
|
||||
<programlisting>
|
||||
EXEMPLE DE SYNTAXE:
|
||||
{func var="test $foo test"} <-- comprends $foo
|
||||
{func var="test $foo_bar test"} <-- comprends $foo_bar
|
||||
{func var="test $foo[0] test"} <-- comprends $foo[0]
|
||||
{func var="test $foo[bar] test"} <-- comprends $foo[bar]
|
||||
{func var="test $foo.bar test"} <-- comprends $foo (not $foo.bar)
|
||||
{func var="test `$foo.bar` test"} <-- comprends $foo.bar
|
||||
|
||||
EXEMPLE PRATIQUE:
|
||||
{include file="subdir/$tpl_name.tpl"} <-- remplace $tpl_name avec la valeur
|
||||
{cycle values="one,two,`$smarty.config.myval`"} <-- doit comporter les
|
||||
apostrophes inverses</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.capture">
|
||||
<title>capture</title>
|
||||
<para>
|
||||
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 $smarty.capture.foo
|
||||
ou 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.
|
||||
</para>
|
||||
<note>
|
||||
<title>Note technique</title>
|
||||
<para>
|
||||
Smarty 1.4.0 - 1.4.4 pla<6C>ait les contenus captur<75>s dans une variable
|
||||
appel<65>e $return. Depuis Smarty 1.4.5, ce comportement <20> <20>t<EFBFBD> modifi<66> et
|
||||
Smarty utilise maintenant l'attribut name en lieu et place.
|
||||
Veuillez donc mettre vos templates <20> jour selon cette r<>gle.
|
||||
</para>
|
||||
</note>
|
||||
<caution>
|
||||
<para>
|
||||
Faites attention lorsque vous interceptez la sortie de commandes
|
||||
<command>insert</command>. Si vous avez configur<75> le cache pour que ce
|
||||
dernier soit actif, et que vous avez des commandes <command>insert</command>
|
||||
suppos<6F>es s'ex<65>cuter dans un contenu en cache, ne tentez pas de capturer
|
||||
ce contenu.
|
||||
</para>
|
||||
</caution>
|
||||
<para>
|
||||
<example>
|
||||
<title>Capturer le contenu d'un template.</title>
|
||||
<programlisting>
|
||||
{* nous ne voulons afficher une ligne que si cette derni<6E>re est activ<69>. *}
|
||||
{capture name=banner}
|
||||
{include file="get_banner.tpl"}
|
||||
{/capture}
|
||||
{if $smarty.capture.banner ne ""}
|
||||
<tr>
|
||||
<td>
|
||||
{$smarty.capture.banner}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,139 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.config.load">
|
||||
<title>config_load</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Nom attribut</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>file</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>re</entry>
|
||||
<entry>Oui</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Le nom du fichier de configuration <20> inclure</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>section</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>re</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Le nom de la section <20> charger</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>scope</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>re</entry>
|
||||
<entry>non</entry>
|
||||
<entry><emphasis>local</emphasis></entry>
|
||||
<entry>
|
||||
La fa<66>on dont la port<72>e des variables est d<>finie, soit
|
||||
local, parent ou global. local signifie que la variable est
|
||||
charg<72>e dans le contexte du template. parent indique que
|
||||
la variable est disponible tant dans le template qui
|
||||
l'a inclus que dans le template parent, ayant r<>alis<69>
|
||||
l'inclusion du sous template. global signifie que la variable
|
||||
est diponible dans tous les templates.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>global</entry>
|
||||
<entry>bool<EFBFBD>en</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>No</emphasis></entry>
|
||||
<entry>
|
||||
Si oui ou non les variables sont disponibles pour les
|
||||
templates parents, identique <20> scope=parent.
|
||||
Note: Cet attribut est obsol<6F>te depuis l'apparition
|
||||
de l'attribut scope, il est toutefois toujours support<72>.
|
||||
Si scope est d<>fini, global est ignor<6F>.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Cette fonction est utilise<73> pour charger des variables de fichier
|
||||
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>
|
||||
|
||||
<programlisting>
|
||||
{config_load file="colors.conf"}
|
||||
|
||||
<html>
|
||||
<title>{#pageTitle#}</title>
|
||||
<body bgcolor="{#bodyBgColor#}">
|
||||
<table border="{#tableBorderSize#}" bgcolor="{#tableBgColor#}">
|
||||
<tr bgcolor="{#rowBgColor#}">
|
||||
<td>First</td>
|
||||
<td>Last</td>
|
||||
<td>Address</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html></programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Les fichiers de configuration peuvent contenir des sections.
|
||||
Vous pouvez charger des variables d'une section donn<6E>e avec le
|
||||
nouvel attribut <emphasis>section</emphasis>.
|
||||
</para>
|
||||
<para>
|
||||
NOTE: Les <emphasis>sections des fichiers de configuration</emphasis>
|
||||
et la fonction native <emphasis>section</emphasis> n'ont rien en
|
||||
commun, il s'av<61>re simplement qu'elles portent le m<>me nom.
|
||||
</para>
|
||||
<example>
|
||||
<title>fonction config_load et section</title>
|
||||
<programlisting>
|
||||
{config_load file="colors.conf" section="client"}
|
||||
|
||||
<html>
|
||||
<title>{#pageTitle#}</title>
|
||||
<body bgcolor="{#bodyBgColor#}">
|
||||
<table border="{#tableBorderSize#}" bgcolor="{#tableBgColor#}">
|
||||
<tr bgcolor="{#rowBgColor#}">
|
||||
<td>First</td>
|
||||
<td>Last</td>
|
||||
<td>Address</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html></programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,136 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.foreach">
|
||||
<title>foreach,foreachelse</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Nom attribut</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>from</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>re</entry>
|
||||
<entry>oui</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Le nom du tableau <20> parcourir</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>item</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>re</entry>
|
||||
<entry>Oui</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Le nom de la variable "<22>l<EFBFBD>ment courant"</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>key</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>re</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Le nom de la variable repr<70>sentant la clef courante.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>name</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>re</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Le nom de la boucle foreach, qui nous permettra
|
||||
d'acc<63>der <20> ses propri<72>t<EFBFBD>s.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Les boucles <emphasis>foreach</emphasis> sont une alternative aux boucles
|
||||
<emphasis>section</emphasis>. Les boucles <emphasis>foreach</emphasis>
|
||||
sont utilis<69>es pour parcourir des tableaux associatifs simples.
|
||||
La syntaxe des boucles <emphasis>foreach</emphasis> est bien plus simple
|
||||
que celle des boucles <emphasis>section</emphasis>, mais en contrepartie,
|
||||
elles ne peuvent <20>tre utilis<69>es que pour des tableaux associatifs simples.
|
||||
La balise <emphasis>foreach</emphasis> doit toujours <20>tre accompagn<67>e
|
||||
de la balise <emphasis>/foreach</emphasis>. Les param<61>tres requis sont
|
||||
<emphasis>from</emphasis> et <emphasis>item</emphasis>. Le nom des boucles
|
||||
foreach doit <20>tre compos<6F>s exclusivement de lettres,
|
||||
chiffres et underscores, selon vos pr<70>f<EFBFBD>rences. Les boucles
|
||||
<emphasis>foreach</emphasis> peuvent <20>tre imbriqu<71>es.
|
||||
La variable <emphasis>from</emphasis> (g<>n<EFBFBD>ralement le tableau <20>
|
||||
parcourir) d<>termine le nombre de fois que <emphasis>foreach</emphasis>
|
||||
sera ex<65>cut<75>. <emphasis>foreachelse</emphasis> est ex<65>cut<75> si aucune
|
||||
valeur n'est pr<70>sente dans la variable donn<6E>e <20> l'attribut
|
||||
<emphasis>from</emphasis>.
|
||||
</para>
|
||||
<example>
|
||||
<title>foreach</title>
|
||||
<programlisting>
|
||||
|
||||
{* Cet exemple affiche toutes les valeurs du tableau $custid *}
|
||||
{foreach from=$custid item=curr_id}
|
||||
id: {$curr_id}<br>
|
||||
{/foreach}
|
||||
|
||||
SORTIE:
|
||||
|
||||
id: 1000<br>
|
||||
id: 1001<br>
|
||||
id: 1002<br></programlisting>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>foreach key</title>
|
||||
<programlisting>
|
||||
{* 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>
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
|
||||
SORTIE:
|
||||
|
||||
tel: 1<br>
|
||||
fax: 2<br>
|
||||
portable: 3<br>
|
||||
tel: 555-4444<br>
|
||||
fax: 555-3333<br>
|
||||
portable: 760-1234<br></programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,102 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.if">
|
||||
<title>if,elseif,else</title>
|
||||
<para>
|
||||
l'instruction if 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
|
||||
moteur de template. Tous les <emphasis>if</emphasis> doivent <20>tre
|
||||
utilis<69>s de pair avec un <emphasis>/if</emphasis>.
|
||||
<emphasis>else</emphasis> et <emphasis>elseif</emphasis> sont <20>galement
|
||||
des balises autoris<69>es. "eq", "ne","neq", "gt", "lt", "lte", "le",
|
||||
"gte" "ge","is even","is odd", "is not even","is not odd","not","mod",
|
||||
"div by","even by","odd by","==","!=",">", "<","<=",">=" sont tous
|
||||
des op<6F>rateurs conditionnels valides, et doivent obligatoirement <20>tre
|
||||
s<>par<61>s des autres <20>l<EFBFBD>ments par des espaces.
|
||||
</para>
|
||||
<example>
|
||||
<title>Instruction if</title>
|
||||
<programlisting>
|
||||
{if $name eq "Fred"}
|
||||
Bienvenue, Monsieur.
|
||||
{elseif $name eq "Wilma"}
|
||||
Bienvenue m'dame.
|
||||
{else}
|
||||
Bienvenue, qui que vous soyez.
|
||||
{/if}
|
||||
|
||||
{* Un exemple avec l'op<6F>rateur or *}
|
||||
{if $name eq "Fred" or $name eq "Wilma"}
|
||||
...
|
||||
{/if}
|
||||
|
||||
{* m<>me chose que ci-dessus *}
|
||||
{if $name == "Fred" || $name == "Wilma"}
|
||||
...
|
||||
{/if}
|
||||
|
||||
{* l'exemple suivant NE fonctionne PAS, les op<6F>rateurs
|
||||
doivent <20>tre entour<75>s d'espaces. *}
|
||||
{if $name=="Fred" || $name=="Wilma"}
|
||||
...
|
||||
{/if}
|
||||
|
||||
|
||||
{* les parenth<74>ses sont autoris<69>es *}
|
||||
{if ( $amount < 0 or $amount > 1000 ) and $volume >= #minVolAmt#}
|
||||
...
|
||||
{/if}
|
||||
|
||||
{* vous pouvez <20>galement faire appel aux fonctions PHP *}
|
||||
{if count($var) gt 0}
|
||||
...
|
||||
{/if}
|
||||
|
||||
{* teste si les valeurs sont paires(even) ou impaires(odd) *}
|
||||
{if $var is even}
|
||||
...
|
||||
{/if}
|
||||
{if $var is odd}
|
||||
...
|
||||
{/if}
|
||||
{if $var is not odd}
|
||||
...
|
||||
{/if}
|
||||
|
||||
{* teste si la variable est divisble par 4 *}
|
||||
{if $var is div by 4}
|
||||
...
|
||||
{/if}
|
||||
|
||||
{* teste si la variable est paire, par groupe de deux i.e.,
|
||||
0=paire, 1=paire, 2=impaire, 3=impaire, 4=paire, 5=paire, etc. *}
|
||||
{if $var is even by 2}
|
||||
...
|
||||
{/if}
|
||||
|
||||
{* 0=paire, 1=paire, 2=paire, 3=impaire, 4=impaire, 5=impaire, etc. *}
|
||||
{if $var is even by 3}
|
||||
...
|
||||
{/if}</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,130 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.include.php">
|
||||
<title>include_php</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Nom attribut</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>file</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>re</entry>
|
||||
<entry>oui</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Le nom du fichier PHP <20> inclure</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>once</entry>
|
||||
<entry>bol<EFBFBD>en</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>true</emphasis></entry>
|
||||
<entry>Inclure plusieurs fois ou non le fichier PHP si
|
||||
plusieurs demandes d'inclusions sont faites.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>re</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>le nom de la variable PHP dans laquelle la sortie
|
||||
sera assign<67>e plut<75>t que directement affich<63>e.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
les balises include_php sont utilis<69>es pour inclure directement
|
||||
un script PHP dans vos templates. Si "security" est activ<69>, alors le script
|
||||
<20> ex<65>cuter doit <20>tre plac<61> dans le chemin $trusted_dir. La balise
|
||||
include_php attends l'attribut "file", qui contient le chemin du
|
||||
fichier PHP <20> inclure, relatif <20> $trusted_dir, ou absolu.
|
||||
</para>
|
||||
<para>
|
||||
include_php est un moyen agr<67>able pour g<>rer des "composants templates",
|
||||
tout en conservant le code PHP en dehors du template lui m<>me.
|
||||
Supposons que vous ayez un template reprenant la navigation de votre
|
||||
site, elle m<>me r<>cup<75>r<EFBFBD>e depuis une base de donn<6E>es. Vous pouvez
|
||||
conserver la logique du code PHP r<>cup<75>rant le contenu de la base dans
|
||||
un emplacement s<>par<61>, et l'inclure depuis votre template. Maintenant,
|
||||
vous pouvez utiliser ce template n'importe ou, sans vous inqui<75>ter de
|
||||
savoir si les informations n<>cessaires ont bien <20>t<EFBFBD>s assign<67>es
|
||||
par l'application, avant la demande d'affichage.
|
||||
</para>
|
||||
<para>
|
||||
Par d<>faut, les fichiers PHP ne sont inclus qu'une seule fois, m<>me si
|
||||
la demande d'inclusion survient plusieurs fois dans le template.
|
||||
Vous pouvez demander <20> ce que ce fichier soit inclus <20> chaque demande
|
||||
gr<67>ce <20> l'attribut <emphasis>once</emphasis>. Mettre l'attribut once <20>
|
||||
false aura pour effet d'inclure le script PHP <20> chaque fois que demand<6E>
|
||||
dans le template.
|
||||
</para>
|
||||
<para>
|
||||
Vous pouvez donner une valeur <20> l'attribut optionnel
|
||||
<emphasis>assign</emphasis>, pour demander <20> la fonction
|
||||
<emphasis>include_php</emphasis> d'assigner la sortie du script PHP
|
||||
<20> la variable sp<73>cifi<66>e plut<75>t que d'en afficher directement le r<>sultat.
|
||||
</para>
|
||||
<para>
|
||||
L'objet Smarty est disponible en tant que $this dans le script PHP inclus.
|
||||
</para>
|
||||
<example>
|
||||
<title>fonction include_php</title>
|
||||
<programlisting>
|
||||
load_nav.php
|
||||
-------------
|
||||
|
||||
<?php
|
||||
|
||||
// charge des variables depuis une base de donn<6E>es mysql et les assigne au template.
|
||||
require_once("MySQL.class.php");
|
||||
$sql = new MySQL;
|
||||
$sql->query("select * from site_nav_sections order by name",SQL_ALL);
|
||||
$this->assign('sections',$sql->record);
|
||||
|
||||
?>
|
||||
|
||||
|
||||
index.tpl
|
||||
---------
|
||||
|
||||
{* chemin absolu, ou relatif <20> $trusted_dir *}
|
||||
{include_php file="/path/to/load_nav.php"}
|
||||
|
||||
{foreach item="curr_section" from=$sections}
|
||||
<a href="{$curr_section.url}">{$curr_section.name}</a><br>
|
||||
{/foreach}</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.include">
|
||||
<title>include</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Nom attribut</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>file</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Oui</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Le nom du template <20> inclure</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Le nom de la variable dans laquelle sera assign<67>e
|
||||
la sortie de include</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>[var ...]</entry>
|
||||
<entry>[type de variable]</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Variables <20> passer au template</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Les balises "include" sont utilis<69>es pour inclure des templates <20>
|
||||
l'int<6E>rieur d'autres templates. Toutes les variables disponibles
|
||||
dans le template r<>alisant l'inclusion sont disponibles dans le
|
||||
template inclus. La balise include doit disposer de l'attribut
|
||||
"file", qui contient le chemin de la ressource template.
|
||||
</para>
|
||||
<para>
|
||||
Vous pouvez sp<73>cifier un attribut optionnel <emphasis>assign</emphasis>
|
||||
qui d<>finit une variable de template dans laquelle la sortie de
|
||||
<emphasis>include</emphasis> sera stock<63>e plut<75>t qu'affich<63>e.
|
||||
</para>
|
||||
<example>
|
||||
<title>fonction include</title>
|
||||
<programlisting>
|
||||
{include file="header.tpl"}
|
||||
|
||||
{* Le corp du template va ici *}
|
||||
|
||||
{include file="footer.tpl"}</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Vous pouvez <20>galement passer des variables au template inclus
|
||||
sous forme d'attributs. Les variables pass<73>es au template par ce moyen
|
||||
ne sont accessibles que dans la port<72>e de ce dernier. Les variables
|
||||
pass<73>es en tant qu'attribut remplacent les variables d<>j<EFBFBD> d<>finies,
|
||||
qui auraient le m<>me nom.
|
||||
</para>
|
||||
<example>
|
||||
<title>fonction include, passage de variables</title>
|
||||
<programlisting>
|
||||
{include file="header.tpl" title="Menu principal" table_bgcolor="#c0c0c0"}
|
||||
|
||||
{* Le corps du template vient ici *}
|
||||
|
||||
{include file="footer.tpl" logo="http://mon.domaine.com/logo.gif"}</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Utilisez la syntaxe <link
|
||||
linkend="template.resources">ressource template</link> pour inclure
|
||||
des fichiers situ<74>s en dehors du r<>pertoire $template_dir.
|
||||
</para>
|
||||
<example>
|
||||
<title>fonction include, exemple de ressource template</title>
|
||||
<programlisting>
|
||||
{* chemin absolu *}
|
||||
{include file="/usr/local/include/templates/header.tpl"}
|
||||
|
||||
{* chemin absolu (m<>me chose) *}
|
||||
{include file="file:/usr/local/include/templates/header.tpl"}
|
||||
|
||||
{* chemin absolu windows (DOIT utiliser le pr<70>fixe "file:") *}
|
||||
{include file="file:C:/www/pub/templates/header.tpl"}
|
||||
|
||||
{* inclusion d'une ressource template "db" *}
|
||||
{include file="db:header.tpl"}</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,143 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.insert">
|
||||
<title>insert</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Nom attribut</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>name</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Oui</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>le nom de la fonction insert (insert_name)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>re</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Le nom de la variable qui recevra la sortie</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>script</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Le nom du script PHP inclus avant que la fonction
|
||||
insert ne soit appel<65>e.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>[var ...]</entry>
|
||||
<entry>[var type]</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Variable <20> passer <20> la fonction insert</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Les balises insert fonctionnent <20> peu pr<70>s comme les balises include,
|
||||
<20> l'exception que leur sortie n'est pas plac<61>e en cache lorsque
|
||||
<link linkend="caching">le cache [caching]</link> est activ<69>.
|
||||
Les balises insert seront ex<65>cut<75>es <20> chaque appel du template.
|
||||
</para>
|
||||
<para>
|
||||
Supposons que vous avez un template avec un emplacement
|
||||
pour un bandeau publicitaire en haut de page.
|
||||
Ce bandeau publicitaire peut contenir toutes sortes de contenus
|
||||
HTML, images, flash, etc. Nous ne pouvons pas placer du contenu
|
||||
statique <20> cet endroit. Nous ne voulons pas non plus que ce
|
||||
contenu fasse partie du cache. Arrive alors la balise insert.
|
||||
Le template connais #emplacement_bandeau# et #id_site# (r<>cup<75>r<EFBFBD>s
|
||||
depuis un fichier de configuration), et <20> besoin d'un appel de
|
||||
fonction pour r<>cup<75>rer le contenu du bandeau.
|
||||
</para>
|
||||
<example>
|
||||
<title>function insert</title>
|
||||
<programlisting>
|
||||
{* exemple de r<>cup<75>ration d'un bandeau publicitaire *}
|
||||
{insert name="getBanner" lid=#emplacement_bandeau# sid=#id_site#}</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Dans cet exemple, nous utilisons le nom getBanner et lui passons les
|
||||
param<61>tres #emplacement_bandeau# et #id_site#. Smarty va rechercher une
|
||||
fonction appel<65>e insert_getBanner () dans votre application PHP, et lui
|
||||
passer les valeurs #banner_location_id# et #site_id# comme premier
|
||||
param<61>tre, dans un tableau associatif. Tous les noms des fonctions insert
|
||||
de votre application doivent <20>tre prefix<69>es de "insert_" pour rem<65>dier
|
||||
<20> d'<27>ventuels conflits de nommage. Votre fonction insert_getBanner ()
|
||||
est suppos<6F>e traiter les valeurs pass<73>es et retourner
|
||||
un r<>sultat. Ces r<>sultats sont affich<63>s dans le template en lieu et
|
||||
place de la balise. Dans cet exemple, Smarty appellera cette fonction
|
||||
insert_getBanner(array("lid" => "12345","sid" => "67890")); et affichera
|
||||
le r<>sultat retourn<72> <20> la place de la balise insert.
|
||||
</para>
|
||||
<para>
|
||||
Si vous donnez une valeur <20> l'attribut "assign", la sortie de la balise
|
||||
insert sera assign<67> <20> une variable de template de ce nom au lieu d'<27>tre
|
||||
affich<63>e directement. NOTE: assigner la sortie <20> une variable n'est pas
|
||||
tr<74>s utile lorsque le cache est activ<69>.
|
||||
</para>
|
||||
<para>
|
||||
Si vous donnez une valeur <20> l'attribut "script", ce script PHP sera
|
||||
inclus (une seule fois) avant l'ex<65>cution de la fonction insert.
|
||||
Le cas peut survenir lorsque la fonction insert n'existe pas encore,
|
||||
et que le script PHP charg<72> de sa d<>finission doit <20>tre inclus. Le
|
||||
chemin doit <20>tre absolu ou relatif <20> $trusted_dir.
|
||||
Lorsque "security" est actif, le script doit <20>tre situ<74>
|
||||
dans $trusted_dir.
|
||||
</para>
|
||||
<para>
|
||||
L'objet Smarty est pass<73> comme second argument. De cette fa<66>on, vous
|
||||
pouvez utiliser ou modifier des informations sur l'objet Smarty,
|
||||
directement depuis votre fonction d'insertion.
|
||||
</para>
|
||||
<note>
|
||||
<title>Note technique</title>
|
||||
<para>
|
||||
Il est possible d'avoir des portions de template qui ne soient pas
|
||||
g<>rables par le cache. M<>me si vous avez activ<69> l'option
|
||||
<link linkend="caching">caching</link>, les balises insert
|
||||
ne feront pas partie du cache. Elles retourneront un contenu dynamique
|
||||
<20> chaque invocation de la page. Cette m<>thode est tr<74>s pratique pour
|
||||
des <20>l<EFBFBD>ments tels que les bandeaux publicitaires, les enqu<71>tes,
|
||||
la m<>t<EFBFBD>o, les r<>sultats de recherche, retours utilisateurs, etc.
|
||||
</para>
|
||||
</note>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.ldelim">
|
||||
<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 "}". Le moteur de template tentera
|
||||
toujours d'interpr<70>ter le contenu entre les d<>limiteurs, c'est donc
|
||||
une fa<66>on d'afficher ces derniers sans interf<72>rer avec Smarty.
|
||||
</para>
|
||||
<example>
|
||||
<title>ldelim, rdelim</title>
|
||||
<programlisting>
|
||||
{* Affiche les d<>limiteurs de template *}
|
||||
|
||||
{ldelim}nomFonction{rdelim} est la fa<66>on dont sont appel<65>es les fonctions dans Smarty !
|
||||
|
||||
|
||||
SORTIE:
|
||||
|
||||
{nomFonction} est la fa<66>on dont sont appel<65>es les fonctions dans Smarty !</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.literal">
|
||||
<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
|
||||
de l'emplois d'<27>l<EFBFBD>ments tels que javascript, acolades et autres
|
||||
qui peuvent confondre le moteur de template. Tout le contenu situ<74>
|
||||
entre les balises {literal}{/literal} ne sera pas interpr<70>t<EFBFBD>, et
|
||||
affich<63> comme du contenu statique.
|
||||
</para>
|
||||
<example>
|
||||
<title>balises literal</title>
|
||||
<programlisting>
|
||||
{literal}
|
||||
<script language=javascript>
|
||||
|
||||
<!--
|
||||
function isblank(field) {
|
||||
if (field.value == '')
|
||||
{ return false; }
|
||||
else
|
||||
{
|
||||
document.loginform.submit();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// -->
|
||||
|
||||
</script>
|
||||
{/literal}</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.php">
|
||||
<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
|
||||
linkend="variable.php.handling">$php_handling</link>. Pour les
|
||||
utilisateurs avanc<6E>s seulement, son utilisation n'est normalement pas
|
||||
n<>cessaire.
|
||||
</para>
|
||||
<example>
|
||||
<title>balises php</title>
|
||||
<programlisting>
|
||||
{php}
|
||||
// inclusion directe d'un script PHP
|
||||
// depuis le template.
|
||||
include("/path/to/display_weather.php");
|
||||
{/php}</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,571 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.section">
|
||||
<title>section,sectionelse</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Nom attribut</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>name</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>re</entry>
|
||||
<entry>Oui</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Le nom de la section</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>loop</entry>
|
||||
<entry>[$nom_variable]</entry>
|
||||
<entry>Oui</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>le nom de la variable qui d<>termine le nombre de
|
||||
fois que la boucle sera ex<65>cut<75>e.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>start</entry>
|
||||
<entry>entier</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>0</emphasis></entry>
|
||||
<entry>La position de l'index ou la section commencera son
|
||||
parcours. Si la valeur donn<6E>e est n<>gative, la position de
|
||||
d<>part est calcul<75>e depuis la fin du tableau. Par exemple,
|
||||
s'il existe 7 valeurs dans le tableau <20> parcourir et que start
|
||||
est <20> -2, l'index de d<>part sera 5. Les valeurs incorrectes
|
||||
(en dehors de la port<72>e du tableau) sont automatiquements
|
||||
tronqu<71>es <20> la valeur correcte la plus proche.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>step</entry>
|
||||
<entry>entier</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>1</emphasis></entry>
|
||||
<entry>La valeur du pas qui sera utilis<69> pour parcourir le
|
||||
tableau.Par exemple, step=2 parcourera les indices
|
||||
0,2,4, etc. Si step est n<>gatif, le tableau sera parcouru en sens
|
||||
inverse.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>max</entry>
|
||||
<entry>entier</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>1</emphasis></entry>
|
||||
<entry>D<EFBFBD>finit le nombre maximum de fois que le tableau sera
|
||||
parcouru.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>show</entry>
|
||||
<entry>bool<EFBFBD>en</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>true</emphasis></entry>
|
||||
<entry>D<EFBFBD>termine s'il est n<>cessaire d'afficher la
|
||||
section ou non.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Les balises <emphasis>section</emphasis> sont utilis<69>es pour
|
||||
parcourir un tableau de donn<6E>es. Toutes les balises
|
||||
<emphasis>section</emphasis> doivent <20>tre utilis<69>es de paire avec
|
||||
les balises <emphasis>/section</emphasis>. Les param<61>tres requis
|
||||
sont <emphasis>name</emphasis> et <emphasis>loop</emphasis>.
|
||||
Le nom de la section est, selon votre choix, compos<6F> de lettres,
|
||||
chiffres et underscores. Les sections peuvent <20>tre imbriqu<71>es,
|
||||
mais leurs noms doivent <20>tre uniques. La variable de parcours
|
||||
(g<>n<EFBFBD>ralement un tableau de donn<6E>es) d<>termine le nombre de fois
|
||||
que la section sera parcourue. Lorsque l'on affiche une variable
|
||||
dans une section, le nom de la section doit pr<70>c<EFBFBD>der
|
||||
la variable entre crochets. <emphasis>sectionelse</emphasis>
|
||||
est ex<65>cut<75> lorsqu'aucune valeur n'est trouv<75>e dans la variable <20>
|
||||
parcourir.
|
||||
</para>
|
||||
<example>
|
||||
<title>section</title>
|
||||
<programlisting>
|
||||
|
||||
{* Cet exemple va afficher toutes les valeurs du tableau $custid *}
|
||||
{section name=client loop=$custid}
|
||||
id: {$custid[client]}<br>
|
||||
{/section}
|
||||
|
||||
SORTIE:
|
||||
|
||||
id: 1000<br>
|
||||
id: 1001<br>
|
||||
id: 1002<br></programlisting>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>section, variable de parcours</title>
|
||||
<programlisting>
|
||||
{* 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=$custid}
|
||||
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>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>nom de section</title>
|
||||
<programlisting>
|
||||
{* 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>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>sections imbriqu<71>es</title>
|
||||
<programlisting>
|
||||
{* 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=$custid}
|
||||
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>
|
||||
{/section}
|
||||
<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@mydomain.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@mydomain.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@mydomain.com<br>
|
||||
<p></programlisting>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>Sections et tableaux associatifs</title>
|
||||
<programlisting>
|
||||
{* 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>
|
||||
{/section}
|
||||
|
||||
|
||||
SORTIE:
|
||||
|
||||
nom: John Smith<br>
|
||||
telephone: 555-555-5555<br>
|
||||
portable: 555-555-5555<br>
|
||||
e-mail: john@mydomain.com<p>
|
||||
nom: Jack Jones<br>
|
||||
telephone: 555-555-5555<br>
|
||||
portable: 555-555-5555<br>
|
||||
e-mail: jack@mydomain.com<p>
|
||||
nom: Jane Munson<br>
|
||||
telephone: 555-555-5555<br>
|
||||
portable: 555-555-5555<br>
|
||||
e-mail: jane@mydomain.com<p></programlisting>
|
||||
</example>
|
||||
|
||||
|
||||
|
||||
<example>
|
||||
<title>sectionelse</title>
|
||||
<programlisting>
|
||||
{* sectionelse est ex<65>cut<75> s'il n'existe aucune valeur dans idClient *}
|
||||
{section name=client loop=$idClient}
|
||||
id: {$idClient[client]}<br>
|
||||
{sectionelse}
|
||||
Aucune valeur dans $idClient.
|
||||
{/section}</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Les sections ont leur propre variable de gestion des propri<72>t<EFBFBD>s.
|
||||
Elles sont de la forme: {$smarty.section.nomSection.nomVariable}
|
||||
</para>
|
||||
<para>
|
||||
NOTE: Depuis Smarty 1.5.0, la syntaxe pour les propi<70>t<EFBFBD>s des sections
|
||||
a <20>t<EFBFBD> chang<6E>e de {%sectionname.varname%} <20>
|
||||
{$smarty.section.nomSection.nomVariable}. L'ancienne syntaxe est toujours
|
||||
support<72>e, mais vous ne verrez que des exemples avec la nouvelle syntaxe
|
||||
dans le manuel.
|
||||
</para>
|
||||
<sect2 id="section.property.index">
|
||||
<title>index</title>
|
||||
<para>
|
||||
Index est utilis<69> pour afficher l'index de parcours courant, commence par
|
||||
0 (ou l'attribut start), et s'incr<63>mente de 1 (ou de la valeur
|
||||
de l'attribut step).
|
||||
</para>
|
||||
<note>
|
||||
<title>Note technique</title>
|
||||
<para>
|
||||
Si les attributs step et start ne sont pas modifi<66>s, alors index
|
||||
fonctionne de la m<>me fa<66>on que iteration, <20> l'exception qu'il commence
|
||||
par 0 plut<75>t que par 1.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>propri<EFBFBD>t<EFBFBD> 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>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.index.prev">
|
||||
<title>index_prev</title>
|
||||
<para>
|
||||
index_prev est utilis<69> pour afficher l'index de parcours
|
||||
pr<70>c<EFBFBD>dent de la boucle. Au premier passage, il vaut -1.
|
||||
</para>
|
||||
<example>
|
||||
<title>propri<EFBFBD>t<EFBFBD> de section index_prev</title>
|
||||
<programlisting>
|
||||
{section name=client loop=$custid}
|
||||
{$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>
|
||||
{/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>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.index.next">
|
||||
<title>index_next</title>
|
||||
<para>
|
||||
index_next est utilis<69> pour afficher la valeur th<74>orique suivante de
|
||||
index. Dans la derni<6E>re boucle, cela reste la valeur incr<63>ment<6E>e,
|
||||
qui respecte l'attribut step si donn<6E>.
|
||||
</para>
|
||||
<example>
|
||||
<title>propri<EFBFBD>t<EFBFBD> de section index_next</title>
|
||||
<programlisting>
|
||||
{section name=client loop=$idClient}
|
||||
{$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>
|
||||
{/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>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.iteration">
|
||||
<title>iteration</title>
|
||||
<para>
|
||||
iteration est utilis<69> pour afficher la valeur courante de l'iteration.
|
||||
</para>
|
||||
<para>
|
||||
NOTE: Cette valeur n'est pas affect<63>e par les attributs start, step et
|
||||
max, <20> l'inverse de la propri<72>t<EFBFBD> index. L'it<69>ration commence par
|
||||
1 et non par 0 (comme le fait index). rownum est un alias de iteration,
|
||||
ils fonctionnent de la m<>me fa<66>on.
|
||||
</para>
|
||||
<example>
|
||||
<title>propri<EFBFBD>t<EFBFBD> iteration de section</title>
|
||||
<programlisting>
|
||||
{section name=client loop=$idClient start=5 step=2}
|
||||
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>
|
||||
{/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>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.first">
|
||||
<title>first</title>
|
||||
<para>
|
||||
first est <20> true lorsque la section est parcouru pour la premi<6D>re fois.
|
||||
</para>
|
||||
<example>
|
||||
<title>propri<EFBFBD>t<EFBFBD> first de la section</title>
|
||||
<programlisting>
|
||||
{section name=client loop=$idClient}
|
||||
{if $smarty.section.client.first}
|
||||
<table>
|
||||
{/if}
|
||||
|
||||
<tr><td>{$smarty.section.client.index} id:
|
||||
{$idClient[client]}</td></tr>
|
||||
|
||||
{if $smarty.section.client.last}
|
||||
</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>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.last">
|
||||
<title>last</title>
|
||||
<para>
|
||||
last est <20> true lorsque la section est parcourue pour la derni<6E>re fois.
|
||||
</para>
|
||||
<example>
|
||||
<title>Propri<EFBFBD>t<EFBFBD> last de section</title>
|
||||
<programlisting>
|
||||
{section name=client loop=$idClient}
|
||||
{if $smarty.section.client.first}
|
||||
<table>
|
||||
{/if}
|
||||
|
||||
<tr><td>{$smarty.section.client.index} id:
|
||||
{$idClient[client]}</td></tr>
|
||||
|
||||
{if $smarty.section.client.last}
|
||||
</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>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.rownum">
|
||||
<title>rownum</title>
|
||||
<para>
|
||||
rownum, utilis<69> pour afficher la valeur courante de l'it<69>ration,
|
||||
commence par 1. C'est un alias de iteration, ils fonctionnent de fa<66>on
|
||||
identique.
|
||||
</para>
|
||||
<example>
|
||||
<title>propri<EFBFBD>t<EFBFBD> rownum de section</title>
|
||||
<programlisting>
|
||||
{section name=client loop=$idClient}
|
||||
{$smarty.section.client.rownum} id: {$idClient[client]}<br>
|
||||
{/section}
|
||||
|
||||
|
||||
SORTIE:
|
||||
|
||||
1 id: 1000<br>
|
||||
2 id: 1001<br>
|
||||
3 id: 1002<br>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.loop">
|
||||
<title>loop</title>
|
||||
<para>
|
||||
loop est utilis<69> pour afficher la derni<6E>re valeur de index que cette
|
||||
section a utilis<69>. Peut <20>tre utilis<69> dans ou en dehors de la section.
|
||||
</para>
|
||||
<example>
|
||||
<title>Propri<EFBFBD>t<EFBFBD> de section index</title>
|
||||
<programlisting>
|
||||
{section name=client loop=$idClient}
|
||||
{$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>
|
||||
|
||||
il y eu 3 clients d'affich<63>s.
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.show">
|
||||
<title>show</title>
|
||||
<para>
|
||||
<emphasis>show</emphasis> est utilis<69> comme param<61>tre de section.
|
||||
<emphasis>show</emphasis> est une valeur bool<6F>enne, true ou false.
|
||||
Si show est <20> "false", la section ne sera pas affich<63>e. Si un
|
||||
sectionelse est pr<70>sent, elle sera affich<63>.
|
||||
</para>
|
||||
<example>
|
||||
<title>section, attribut show</title>
|
||||
<programlisting>
|
||||
{* $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>
|
||||
{/section}
|
||||
|
||||
{if $smarty.section.client.show}
|
||||
la section <20> <20>t<EFBFBD> affich<63>e.
|
||||
{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>
|
||||
|
||||
la section <20> <20>t<EFBFBD> affich<63>e.
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="section.property.total">
|
||||
<title>total</title>
|
||||
<para>
|
||||
total est utilis<69> pour afficher le nombre d'it<69>ration que la section
|
||||
va ex<65>cuter. Peut <20>tre utilis<69> dans ou en dehors de la section.
|
||||
</para>
|
||||
<example>
|
||||
<title>section, propri<72>t<EFBFBD> total</title>
|
||||
<programlisting>
|
||||
{section name=client loop=$idClient step=2}
|
||||
{$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>
|
||||
|
||||
Il y eu 3 clients affich<63>s.
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,75 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.strip">
|
||||
<title>strip</title>
|
||||
<para>
|
||||
Il est fr<66>quent que les designers web rencontrent des probl<62>mes
|
||||
dus aux espaces et retours chariots, qui affectent le rendu HTML
|
||||
("fonctionnalit<69>s" des navigateurs), les obligeant <20> coller les
|
||||
balises les unes aux autres. Cette solution rend g<>n<EFBFBD>ralement le
|
||||
code illisible et impossible <20> maintenir.
|
||||
</para>
|
||||
<para>
|
||||
Tout contenu situ<74> entre les balises {strip}{/strip} se verra
|
||||
all<6C>g<EFBFBD> des espaces superflus et des retours chariots en d<>but ou en fin
|
||||
de ligne, avant qu'il ne soit affich<63>s. De la sorte, vous pouvez
|
||||
conserver vos templates lisibles, sans vous soucier des effets
|
||||
ind<6E>sirables que peuvent apporter les espaces superflus.
|
||||
</para>
|
||||
<note>
|
||||
<title>Note technique</title>
|
||||
<para>
|
||||
{strip}{/strip} n'affecte en aucun cas le contenu des variables de
|
||||
template. Voir le <link linkend="language.modifier.strip">modificateur
|
||||
strip</link> pour un rendu identique pour les variables.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>balises strip</title>
|
||||
<programlisting>
|
||||
{* la suite sera affich<63>e sur une seule ligne *}
|
||||
{strip}
|
||||
<table border=0>
|
||||
<tr>
|
||||
<td>
|
||||
<A HREF="{$url}">
|
||||
<font color="red">Un test</font>
|
||||
</A>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{/strip}
|
||||
|
||||
|
||||
SORTIE:
|
||||
|
||||
<table border=0><tr><td><A HREF="http://mon.domaine.com"><font color="red">Un test</font></A></td></tr></table></programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Notez que dans l'exemple ci-dessus, toutes les lignes commencent et
|
||||
se terminent par des balises HTML. Sachez que si vous avez du texte
|
||||
en d<>but ou en fin de ligne dans des balises strip, ce dernier sera coll<6C>
|
||||
au suivant/pr<70>c<EFBFBD>dent et risque de ne pas <20>tre affich<63> selon
|
||||
l'effet d<>sir<69>.
|
||||
</para>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.assign">
|
||||
<title>assign</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Nom attribut</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>var</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>re</entry>
|
||||
<entry>Oui</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Le nom de la variable assign<67>e</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>value</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>re</entry>
|
||||
<entry>Oui</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>La valeur assign<67>e</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Assign est utilis<69> pour d<>clarer ou modifier des variables de template.
|
||||
</para>
|
||||
<example>
|
||||
<title>assign</title>
|
||||
<programlisting>
|
||||
{assign var="name" value="Bob"}
|
||||
|
||||
La valeur de $name est {$name}.
|
||||
|
||||
SORTIE:
|
||||
|
||||
La valeur de $name est Bob.</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,119 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.counter">
|
||||
<title>counter</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Nom attribut</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>name</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>re</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>default</emphasis></entry>
|
||||
<entry>Le nom du compteur</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>start</entry>
|
||||
<entry>num<EFBFBD>rique</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>1</emphasis></entry>
|
||||
<entry>La valeur initiale du compteur</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>skip</entry>
|
||||
<entry>num<EFBFBD>rique</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>1</emphasis></entry>
|
||||
<entry>L'intervale du compteur</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>direction</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>up</emphasis></entry>
|
||||
<entry>la direction du compteur (up/down) [compte / d<>compte]</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>print</entry>
|
||||
<entry>bool<EFBFBD>en</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>true</emphasis></entry>
|
||||
<entry>S'il faut afficher cette valeur ou non</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>La variable dans laquelle la valeur du compteur
|
||||
sera assign<67>e.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
counter affiche un compteur. counter retient la valeur
|
||||
du compte <20> chaque it<69>ration. Vous pouvez adapter le nombre, l'intervale
|
||||
et la direction du compteur, ainsi que d<>cider d'afficher ou non
|
||||
les valeurs. Vous pouvez lancer plusieurs compteurs simultan<61>ment en
|
||||
leur donnant des noms uniques. Si vous ne donnez pas de nom <20> un
|
||||
compteur, 'default' sera utilis<69>.
|
||||
</para>
|
||||
<para>
|
||||
Si vous donnez une valeur <20> l'attribut "assign", alors la sortie de la
|
||||
fonction counter sera assign<67>e <20> la variable de template donn<6E>e plut<75>t
|
||||
que d'<27>tre directement affich<63>e.
|
||||
</para>
|
||||
<example>
|
||||
<title>counter</title>
|
||||
<programlisting>
|
||||
{* initialisation du compteur *}
|
||||
{counter start=0 skip=2 print=false}
|
||||
|
||||
{counter}<br>
|
||||
{counter}<br>
|
||||
{counter}<br>
|
||||
{counter}<br>
|
||||
|
||||
SORTIE:
|
||||
|
||||
2<br>
|
||||
4<br>
|
||||
6<br>
|
||||
8<br></programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,134 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.cycle">
|
||||
<title>cycle</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Nom attribut</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>name</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>default</emphasis></entry>
|
||||
<entry>Le nom du cycle</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>values</entry>
|
||||
<entry>divers</entry>
|
||||
<entry>Oui</entry>
|
||||
<entry><emphasis>N/A</emphasis></entry>
|
||||
<entry>Les valeurs sur lesquelles boucler, soit une liste
|
||||
s<>par<61>e par des virgules, (voir l'attribut delimiter),
|
||||
soit un tableau de valeurs.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>print</entry>
|
||||
<entry>bool<EFBFBD>en</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>true</emphasis></entry>
|
||||
<entry>S'il faut afficher ou non cette valeur</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>advance</entry>
|
||||
<entry>bool<EFBFBD>en</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>true</emphasis></entry>
|
||||
<entry>Oui ou non aller <20> la procha<68>ne valeur</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>delimiter</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>,</emphasis></entry>
|
||||
<entry>Le d<>limiteur <20> utiliser dans la liste.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>La variable de template dans laquelle la sortie
|
||||
sera assign<67>e</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
cycle est utilis<69> pour boucler sur un ensemble de valeurs. Tr<54>s pratique
|
||||
pour alterner entre deux ou plusieurs couleurs dans un tableau,
|
||||
ou plus g<>n<EFBFBD>ralement pour boucler sur les valeurs d'un tableau.
|
||||
</para>
|
||||
<para>
|
||||
Vous pouvez d<>finir plusieurs "cycle" dans votre template, en leur
|
||||
donnant des noms uniques (attribut name).
|
||||
</para>
|
||||
<para>
|
||||
Vous pouvez emp<6D>cher la valeur courante de s'afficher en d<>finissant
|
||||
l'attribut print <20> false. Ce proc<6F>d<EFBFBD> peut <20>tre utile pour discr<63>tement
|
||||
passer outre une valeur de la liste.
|
||||
</para>
|
||||
<para>
|
||||
L'attribut advance est utilis<69> pour r<>p<EFBFBD>ter une valeur. Lorsque
|
||||
d<>finit <20> false, le prochain appel de cycle ram<61>nera la m<>me valeur.
|
||||
</para>
|
||||
<para>
|
||||
Si vous d<>finissez l'attribut sp<73>cial "assign", la sortie de la fonction
|
||||
cycle y sera assign<67>e plut<75>t que d'<27>tre directement affich<63>e.
|
||||
</para>
|
||||
<example>
|
||||
<title>cycle</title>
|
||||
<programlisting>
|
||||
{section name=rows loop=$data}
|
||||
<tr bgcolor="{cycle values="#eeeeee,#d0d0d0"}">
|
||||
<td>{$data[rows]}</td>
|
||||
</tr>
|
||||
{/section}
|
||||
|
||||
SORTIE:
|
||||
|
||||
<tr bgcolor="#eeeeee">
|
||||
<td>1</td>
|
||||
</tr>
|
||||
<tr bgcolor="#d0d0d0">
|
||||
<td>2</td>
|
||||
</tr>
|
||||
<tr bgcolor="#eeeeee">
|
||||
<td>3</td>
|
||||
</tr>
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.debug">
|
||||
<title>debug</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Nom attribut</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>output</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>html</emphasis></entry>
|
||||
<entry>Type de sortie, html ou javascript</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
{debug} am<61>ne la console de d<>bogage sur la page. Fonctionne
|
||||
quelle que soit la valeur du param<61>tre <link
|
||||
linkend="chapter.debugging.console">debug</link> de Smarty.
|
||||
Comme ce dernier est appel<65> lors de l'ex<65>cution, il n'est capable
|
||||
d'afficher que les variables assign<67>es au template, et non
|
||||
les templates en cours d'utilisation. Toutefois, vous voyez toutes
|
||||
les variables disponibles pour le template courant.
|
||||
</para>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.eval">
|
||||
<title>eval</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Nom attribut</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>var</entry>
|
||||
<entry>mixed</entry>
|
||||
<entry>Oui</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>variable (ou cha<68>ne de caract<63>res) <20> <20>valuer</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Le nom de la variable PHP dans laquelle la sortie
|
||||
sera assign<67>e</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
eval <20>value une variable comme si cette derni<6E>re <20>tait un template.
|
||||
Peut <20>tre utile pour embarquer des balises de templates ou des variables
|
||||
de template dans des variables ou des balises/variables dans des
|
||||
variables de fichiers de configuration.
|
||||
</para>
|
||||
<para>
|
||||
Si vous d<>finissez l'attribut "assign", la sortie sera assign<67>e <20> la
|
||||
variable de template d<>sign<67>e plut<75>t que d'<27>tre affich<63>e dans le
|
||||
template.
|
||||
</para>
|
||||
<note>
|
||||
<title>Note technique</title>
|
||||
<para>
|
||||
Les variables <20>valu<6C>es sont trait<69>es de la m<>me fa<66>on que les templates.
|
||||
Elles suivent les m<>mes r<>gles de traitement et de s<>curit<69>, comme si
|
||||
elles <20>taient r<>ellement des templates.
|
||||
</para>
|
||||
</note>
|
||||
<note>
|
||||
<title>Note technique</title>
|
||||
<para>
|
||||
Les variables <20>valu<6C>es sont compil<69>es <20> chaque invocation, et la version
|
||||
compil<69>e n'est pas sauvegard<72>e ! Toutefois, si le cache est activ<69>,
|
||||
la sortie sera plac<61>e en cache avec le reste du template.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>eval</title>
|
||||
<programlisting>
|
||||
setup.conf
|
||||
----------
|
||||
|
||||
emphstart = <b>
|
||||
emphend = </b>
|
||||
titre = Bienvenue sur la homepage de {$company} !
|
||||
ErrorVille = Vous devez sp<73>cifier un nom de {#emphstart#}ville{#emphend#}.
|
||||
ErrorDept = Vous devez sp<73>cifier un {#emphstart#}d<>partement{#emphend#}.
|
||||
|
||||
|
||||
index.tpl
|
||||
---------
|
||||
|
||||
{config_load file="setup.conf"}
|
||||
|
||||
{eval var=$foo}
|
||||
{eval var=#titre#}
|
||||
{eval var=#ErrorVille#}
|
||||
{eval var=#ErrorDept# assign="state_error"}
|
||||
{$state_error}
|
||||
|
||||
SORTIE:
|
||||
|
||||
Ceci est le contenu de foo.
|
||||
Bienvenue sur la homepage de FictifLand.
|
||||
Vous devez sp<73>cifier un nom de <b>ville</b>.
|
||||
Vous devez sp<73>cifier un <b>d<EFBFBD>partement</b>.
|
||||
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,107 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.fetch">
|
||||
<title>fetch</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Nom attribut</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>file</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Oui</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>le fichier, site http ou ftp <20> r<>cup<75>rer</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>le nom de la variable PHP dans laquelle la sortie
|
||||
sera assign<67>e plut<75>t que d'<27>tre directement affich<63>e.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
fetch est utilis<69> pour r<>cup<75>rer des fichiers depuis le syst<73>me de
|
||||
fichier local, depuis un serveur http ou ftp, et en afficher le contenu.
|
||||
Si le nom du fichier commence par "http://", la page internet sera
|
||||
r<>cup<75>r<EFBFBD>e, puis affich<63>e. Si le nom du fichier commence par "ftp://",
|
||||
le fichier sera r<>cup<75>r<EFBFBD> depuis le serveur ftp, et affich<63>.
|
||||
Pour les fichiers du syst<73>me local, le chemin doit <20>tre absolu ou
|
||||
relatif au chemin d'ex<65>cution du script PHP.
|
||||
</para>
|
||||
<para>
|
||||
Vous pouvez sp<73>cifier l'attribut optionnel <emphasis>assign</emphasis>
|
||||
qui d<>fini une variable de template dans laquelle la sortie
|
||||
sera stock<63>e plut<75>t qude d'<27>tre affich<63>e (nouveau dans Smarty 1.5.0).
|
||||
</para>
|
||||
<note>
|
||||
<title>Note technique</title>
|
||||
<para>Ne supporte pas les redirections http. Assurez vous d'inclure les
|
||||
slash de fin sur votre page web si n<>cessaire.
|
||||
</para>
|
||||
</note>
|
||||
<note>
|
||||
<title>Note technique</title>
|
||||
<para>
|
||||
Si la s<>curit<69> est activ<69>e, vous ne pourez r<>cup<75>rer les
|
||||
fichiers du syst<73>me local que s'ils sont situ<74>s dans l'un des
|
||||
r<>pertoires s<>curis<69> ($secure_dir).
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>fetch</title>
|
||||
<programlisting>
|
||||
{* Inclus du javascript dans votre template *}
|
||||
{fetch file="/export/httpd/www.domain.com/docs/navbar.js"}
|
||||
|
||||
{* r<>cup<75>re les informations m<>t<EFBFBD>o d'un autre site sur votre page *}
|
||||
{fetch file="http://www.myweather.com/68502/"}
|
||||
|
||||
{* r<>cup<75>re les titres depuis un fichier ftp *}
|
||||
{fetch file="ftp://user:password@ftp.domain.com/path/to/currentheadlines.txt"}
|
||||
|
||||
{* assigne le contenu r<>cup<75>r<EFBFBD> <20> une variable de template *}
|
||||
{fetch file="http://www.myweather.com/68502/" assign="weather"}
|
||||
{if $weather ne ""}
|
||||
<b>{$weather}</b>
|
||||
{/if}</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,146 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.html.checkboxes">
|
||||
<title>html_checkboxes</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Nom attribut</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>name</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>checkbox</emphasis></entry>
|
||||
<entry>Nom de la liste de cases <20> cocher</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>values</entry>
|
||||
<entry>array</entry>
|
||||
<entry>Oui, <20> moins que vous n'utilisiez l'attribut
|
||||
option</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Un tableau de valeurs pour les cases <20>
|
||||
cocher</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>output</entry>
|
||||
<entry>array</entry>
|
||||
<entry>Oui, <20> moins que vous n'utilisiez l'attribut
|
||||
option</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Un tableau de sortie pour les cases <20> cocher</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>checked</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>Les <20>l<EFBFBD>ments coch<63>s de la liste</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>options</entry>
|
||||
<entry>associative array</entry>
|
||||
<entry>Oui, <20> moins que vous n'utilisiez values et
|
||||
output</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Un tableau associatif de valeurs et
|
||||
sorties</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>separator</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>re pour s<>parer chaque case
|
||||
<20> cocher</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
html_checkboxes est une fonction utilisateur qui cr<63>e un groupe de
|
||||
cases <20> cocher avec les donn<6E>es fournies. Elle prend en compte la liste
|
||||
des <20>l<EFBFBD>ments s<>lectionn<6E>s par d<>faut. Les attributs requis sont
|
||||
values et output, <20> moins que vous n'utilisiez options <20> la place.
|
||||
La sortie g<>n<EFBFBD>r<EFBFBD>e est compatible XHTML.
|
||||
</para>
|
||||
<para>
|
||||
Tous les param<61>tres qui ne sont pas list<73>s ci-dessus sont affich<63>s
|
||||
en tant que paires nom/valeur dans chaque balise <input> cr<63>e.
|
||||
</para>
|
||||
<example>
|
||||
<title>html_checkboxes</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('id_client', array(1000,1001,1002,1003));
|
||||
$smarty->assign('cust_names', array('Joe Schmoe','Jack Smith','Jane
|
||||
Johnson','Charlie Brown'));
|
||||
$smarty->assign('client_id', 1001);
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
|
||||
index.tpl:
|
||||
|
||||
{html_checkboxes values=$id_client checked=$client_id output=$nom_client separator="<br />"}
|
||||
|
||||
|
||||
index.php:
|
||||
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('cust_checkboxes', array(
|
||||
1001 => 'Joe Schmoe',
|
||||
1002 => 'Jack Smith',
|
||||
1003 => 'Jane Johnson','Charlie Brown'));
|
||||
$smarty->assign('client_id', 1001);
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
{html_checkboxes name="id" options=$cust_checkboxes checked=$client_id separator="<br />"}
|
||||
|
||||
|
||||
SORTIE: (pour les deux exemples)
|
||||
|
||||
<input type="checkbox" name="id[]" value="1000">Joe Schmoe<br />
|
||||
<input type="checkbox" name="id[]" value="1001" checked="checked"><br />
|
||||
<input type="checkbox" name="id[]" value="1002">Jane Johnson<br />
|
||||
<input type="checkbox" name="id[]" value="1003">Charlie Brown<br /></programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.html.image">
|
||||
<title>html_image</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Nom attribut</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>file</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Oui</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>nom/chemin des images</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>border</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>0</emphasis></entry>
|
||||
<entry>Bordure de l'image</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>height</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>Hauteur de l'image actuelle</emphasis></entry>
|
||||
<entry>Hauteur de l'image <20> afficher</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>width</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>Longueur de l'image actuelle</emphasis></entry>
|
||||
<entry>Longueur de l'image <20> afficher</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>basedir</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>non</entry>
|
||||
<entry><emphasis>racine du serveur web</emphasis></entry>
|
||||
<entry>r<EFBFBD>pertoire depuis lequel baser le calcul des
|
||||
chemins relatifs</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>link</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>lien sur lequel l'image pointe</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
html_image est une fonction utilisateur qui g<>n<EFBFBD>re la balise
|
||||
HTML pour une image. La hauteur et la longueur de l'image sont calcul<75>s
|
||||
automatiquement depuis le fichier image si aucune n'est sp<73>cifi<66>e.
|
||||
</para>
|
||||
<para>
|
||||
basedir est le r<>pertoire de base depuis lequel seront calcul<75>s les
|
||||
chemins relatifs. Si non sp<73>cifi<66>, la racine du serveur web est utilis<69>
|
||||
(variable d'environnement DOCUMENT_ROOT). Si la s<>curit<69> est activ<69>e,
|
||||
l'image doit se situer dans un r<>pertoire s<>curis<69>.
|
||||
</para>
|
||||
<para>
|
||||
link est la valeur href <20> laquelle lier l'image. Si link est d<>fini,
|
||||
une balise <a href="VALEURLINK"><a> est plac<61>e autour de
|
||||
l'image.
|
||||
</para>
|
||||
<note>
|
||||
<title>Note technique</title>
|
||||
<para>
|
||||
html_image requiert un acc<63>s au disque dur pour lire l'image et
|
||||
calculer ses dimensions. Si vous n'utilisez pas un cache, il
|
||||
est g<>n<EFBFBD>ralement pr<70>f<EFBFBD>rable d'<27>viter d'utiliser html_image
|
||||
et de laisser les balises images statiques pour de meilleures
|
||||
performances.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>html_image</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
{image file="pumpkin.jpg"}
|
||||
{image file="/path/from/docroot/pumpkin.jpg"}
|
||||
{image file="../path/relative/to/currdir/pumpkin.jpg"}
|
||||
|
||||
SORTIE: (possible)
|
||||
|
||||
<img src="pumpkin.jpg" border="0" width="44" height="68">
|
||||
<img src="/path/under/docroot/pumpkin.jpg" border="0" width="44" height="68">
|
||||
<img src="../path/relative/to/currdir/pumpkin.jpg" border="0" width="44" height="68"></programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,154 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.html.options">
|
||||
<title>html_options</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Nom attribut</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>values</entry>
|
||||
<entry>array</entry>
|
||||
<entry>Oui, <20> moins que vous n'utilisiez
|
||||
l'attribut options</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>un tableau de valeurs pour les listes
|
||||
d<>roulantes</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>output</entry>
|
||||
<entry>array</entry>
|
||||
<entry>Oui, <20> moins que vous n'utilisiez
|
||||
l'attribut options</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Un tableau de libell<6C>s pour la liste
|
||||
d<>roulante</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>selected</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res/tableau</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>Les <20>l<EFBFBD>ments s<>lectionn<6E>s</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>options</entry>
|
||||
<entry>Tableau associatif</entry>
|
||||
<entry>Oui, <20> moins que vous n'utilisiez option
|
||||
et values</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Un tableau associatif valeur / libell<6C></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>name</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>Nom du goupe d'options</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
html_options est une fonction utilisateur qui cr<63>e un groupe d'options
|
||||
avec les donn<6E>es fournies. Elle prend en charge les <20>l<EFBFBD>ments
|
||||
s<>lectionn<6E>s par d<>faut. Les attributs requis sont values et output,
|
||||
<09> moins que vous n'utilisiez options <20> la place.
|
||||
</para>
|
||||
<para>
|
||||
Si la valeur donn<6E>e est un tableau, elle sera trait<69>e comme un
|
||||
OPTGROUP html, et affich<63>e. La r<>cursivit<69> est support<72>e avec
|
||||
OPTGROUP. La sortie est compatible XHTML.
|
||||
</para>
|
||||
<para>
|
||||
Si l'attribut optionnel <emphasis>name</emphasis> est donn<6E>, les
|
||||
balises <select name="groupname"></select> entoureront la
|
||||
liste d'options.
|
||||
</para>
|
||||
<para>
|
||||
Tous les param<61>tres qui ne sont pas dans la liste ci-dessus sont
|
||||
affich<63>s en tant que paires nom / valeur. Ils sont ignor<6F>s si
|
||||
le param<61>tre optionnel <emphasis>name</emphasis> n'est pas donn<6E>.
|
||||
</para>
|
||||
<example>
|
||||
<title>html_options</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('id_client', array(1000,1001,1002,1003));
|
||||
$smarty->assign('nom_client', array('Joe Schmoe','Jack Smith','Jane
|
||||
Johnson','Charlie Brown'));
|
||||
$smarty->assign('client_id', 1001);
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
<select name=client_id>
|
||||
{html_options values=$id_client selected=$client_id output=$nom_client}
|
||||
</select>
|
||||
|
||||
|
||||
index.php:
|
||||
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('cust_options', array(
|
||||
1001 => 'Joe Schmoe',
|
||||
1002 => 'Jack Smith',
|
||||
1003 => 'Jane Johnson',
|
||||
1004 => 'Charlie Brown'));
|
||||
$smarty->assign('client_id', 1001);
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
<select name=client_id>
|
||||
{html_options options=$cust_options selected=$client_id}
|
||||
</select>
|
||||
|
||||
|
||||
SORTIE: (valable pour les deux exemples)
|
||||
|
||||
<select name=client_id>
|
||||
<option value="1000">Joe Schmoe</option>
|
||||
<option value="1001" selected="selected">Jack Smith</option>
|
||||
<option value="1002">Jane Johnson</option>
|
||||
<option value="1003">Charlie Brown</option>
|
||||
</select></programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.html.radios">
|
||||
<title>html_radios</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Nom attribut</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>name</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>radio</emphasis></entry>
|
||||
<entry>nom de la liste boutons radio</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>values</entry>
|
||||
<entry>tableau</entry>
|
||||
<entry>Oui, <20> moins que vous n'utilisiez l'attribut
|
||||
options</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Le tableau des valeurs des boutons radio</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>output</entry>
|
||||
<entry>tableau</entry>
|
||||
<entry>Oui, <20> moins que vous n'utilisiez l'attribut
|
||||
options</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Un tableau de libell<6C>s pour les boutons radio</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>checked</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>Les boutons radios s<>lectionn<6E>s</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>options</entry>
|
||||
<entry>tableau associatif</entry>
|
||||
<entry>Oui, <20> moins que vous n'utilisiez values
|
||||
et outputs</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>un tableau associatif valeurs / libell<6C>s</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>separator</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>cha<EFBFBD>ne de s<>paration <20> placer entre les
|
||||
boutons radio</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
html_radio est une fonction utilisateur qui cr<63>e des boutons radio
|
||||
html <20> partir des donn<6E>es fournies. Elle prend en charge les <20>l<EFBFBD>ments
|
||||
s<>lectionn<6E>s par d<>faut. Les attributs requis sont values et output,
|
||||
<20> moins que vous n'utilisiez options <20> la place. La sortie g<>n<EFBFBD>r<EFBFBD>e est
|
||||
compatible XHTML.
|
||||
</para>
|
||||
<para>
|
||||
Tous les param<61>tres qui ne sont pas dans la liste ci dessus sont
|
||||
affich<63>s en tant que paires nom / valeur dans chaque balise <input>
|
||||
cr<63><72>e.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>html_radios</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('id_client', array(1000,1001,1002,1003));
|
||||
$smarty->assign('nom_client', array('Joe Schmoe','Jack Smith','Jane
|
||||
Johnson','Charlie Brown'));
|
||||
$smarty->assign('client_id', 1001);
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
|
||||
index.tpl:
|
||||
|
||||
{html_radios values=$id_client checked=$client_id output=$nom_client separator="<br />"}
|
||||
|
||||
|
||||
index.php:
|
||||
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('cust_radios', array(
|
||||
1001 => 'Joe Schmoe',
|
||||
1002 => 'Jack Smith',
|
||||
1003 => 'Jane Johnson',
|
||||
1004 => 'Charlie Brown'));
|
||||
$smarty->assign('client_id', 1001);
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
|
||||
index.tpl:
|
||||
|
||||
{html_radios name="id" options=$cust_radios checked=$client_id separator="<br />"}
|
||||
|
||||
|
||||
SORTIE: (both examples)
|
||||
|
||||
<input type="radio" name="id[]" value="1000">Joe Schmoe<br />
|
||||
<input type="radio" name="id[]" value="1001" checked="checked"><br />
|
||||
<input type="radio" name="id[]" value="1002">Jane Johnson<br />
|
||||
<input type="radio" name="id[]" value="1003">Charlie Brown<br /></programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,325 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.html.select.date">
|
||||
<title>html_select_date</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Nom attribut</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>prefix</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>Date_</entry>
|
||||
<entry>Avec quoi pr<70>fixer le nom de variable</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>time</entry>
|
||||
<entry>timestamp/YYYY-MM-DD</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>la date courante au format unix YYYY-MM-DD
|
||||
format</entry>
|
||||
<entry>la date / heure <20> utiliser</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>start_year</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>current year</entry>
|
||||
<entry>La premi<6D>re ann<6E>e dans la liste d<>roulante, soit
|
||||
le num<75>ro de l'ann<6E>e, soit un nombre relatif <20> l'ann<6E>e
|
||||
courante (+/- N).</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>end_year</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>m<EFBFBD>me chose que start_year</entry>
|
||||
<entry>La derni<6E>re ann<6E>e dans la liste d<>roulante, soit
|
||||
le num<75>ro de l'ann<6E>e, soit un nombre relatif <20> l'ann<6E>e
|
||||
courante (+/- N).</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_days</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>true</entry>
|
||||
<entry>Si l'on souhaite afficher les jours ou pas.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_months</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>true</entry>
|
||||
<entry>Si l'on souhaite afficher les mois ou pas.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_years</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>true</entry>
|
||||
<entry>Si l'on souhaite afficher les ann<6E>es ou pas.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>month_format</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>%B</entry>
|
||||
<entry>le format du mois (strftime)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>day_format</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>%02d</entry>
|
||||
<entry>Le format du jour (sprintf)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>day_value_format</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>%d</entry>
|
||||
<entry>le format de la valeur du jour (sprintf)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>year_as_text</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>false</entry>
|
||||
<entry>S'il faut afficher l'ann<6E>e au format texte</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>reverse_years</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>false</entry>
|
||||
<entry>Affiche les ann<6E>es dans l'ordre inverse</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>field_array</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>null</entry>
|
||||
<entry>
|
||||
Si un nom est donn<6E>, la liste d<>roulante sera affich<63>e
|
||||
de telle fa<66>on que les r<>sultats seront retourn<72>s <20> PHP
|
||||
sous la forme nom[Day] (jour), nom[Year] (ann<6E>e),
|
||||
nom[Month] (Mois).
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>day_size</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Ajoute un attribut size <20> la liste
|
||||
d<>roulante des jours.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>month_size</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Ajoute un attribut size <20> la liste
|
||||
d<>roulante des mois.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>year_size</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Ajoute un attribut size <20> la liste
|
||||
d<>roulante des ann<6E>es.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>all_extra</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Ajoute des attributs suppl<70>mentaires <20>
|
||||
toutes les balises select/input.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>day_extra</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Ajoute des attributs suppl<70>mentaires aux balises
|
||||
select/input du jour.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>month_extra</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Ajoute des attributs suppl<70>mentaires aux balises
|
||||
select/input du mois.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>year_extra</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Ajoute des attributs suppl<70>mentaires aux balises
|
||||
select/input de l'ann<6E>e.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>field_order</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>MDY</entry>
|
||||
<entry>L'ordre dans lequel afficher les
|
||||
listes d<>roulantes.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>field_separator</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>\n</entry>
|
||||
<entry>la cha<68>ne de caract<63>res affich<63>e entre les
|
||||
diff<66>rents champs.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>month_value_format</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>%m</entry>
|
||||
<entry>Le format strftime de la valeur des mois, par d<>faut %m
|
||||
pour les num<75>ros.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
html_select_date est une fonction utilisateur qui cr<63>e des listes
|
||||
d<>roulantes pour saisir la date. Elle peut afficher n'importe quel
|
||||
jour, mois et ann<6E>e.
|
||||
</para>
|
||||
<example>
|
||||
<title>html_select_date</title>
|
||||
<programlisting>
|
||||
{html_select_date}
|
||||
|
||||
|
||||
SORTIE:
|
||||
|
||||
<select name="Date_Month">
|
||||
<option value="1">January</option>
|
||||
<option value="2">February</option>
|
||||
<option value="3">March</option>
|
||||
<option value="4">April</option>
|
||||
<option value="5">May</option>
|
||||
<option value="6">June</option>
|
||||
<option value="7">July</option>
|
||||
<option value="8">August</option>
|
||||
<option value="9">September</option>
|
||||
<option value="10">October</option>
|
||||
<option value="11">November</option>
|
||||
<option value="12" selected>December</option>
|
||||
</select>
|
||||
<select name="Date_Day">
|
||||
<option value="1">01</option>
|
||||
<option value="2">02</option>
|
||||
<option value="3">03</option>
|
||||
<option value="4">04</option>
|
||||
<option value="5">05</option>
|
||||
<option value="6">06</option>
|
||||
<option value="7">07</option>
|
||||
<option value="8">08</option>
|
||||
<option value="9">09</option>
|
||||
<option value="10">10</option>
|
||||
<option value="11">11</option>
|
||||
<option value="12">12</option>
|
||||
<option value="13" selected>13</option>
|
||||
<option value="14">14</option>
|
||||
<option value="15">15</option>
|
||||
<option value="16">16</option>
|
||||
<option value="17">17</option>
|
||||
<option value="18">18</option>
|
||||
<option value="19">19</option>
|
||||
<option value="20">20</option>
|
||||
<option value="21">21</option>
|
||||
<option value="22">22</option>
|
||||
<option value="23">23</option>
|
||||
<option value="24">24</option>
|
||||
<option value="25">25</option>
|
||||
<option value="26">26</option>
|
||||
<option value="27">27</option>
|
||||
<option value="28">28</option>
|
||||
<option value="29">29</option>
|
||||
<option value="30">30</option>
|
||||
<option value="31">31</option>
|
||||
</select>
|
||||
<select name="Date_Year">
|
||||
<option value="2001" selected>2001</option>
|
||||
</select></programlisting>
|
||||
</example>
|
||||
|
||||
|
||||
<example>
|
||||
<title>html_select_date</title>
|
||||
<programlisting>
|
||||
|
||||
{* le d<>marage et la fin de l'ann<6E>e peuvent <20>tre relatif <20> l'ann<6E>e courante *}
|
||||
{html_select_date prefix="StartDate" time=$time start_year="-5" end_year="+1" display_days=false}
|
||||
|
||||
SORTIE: (current year is 2000)
|
||||
|
||||
<select name="StartDateMonth">
|
||||
<option value="1">January</option>
|
||||
<option value="2">February</option>
|
||||
<option value="3">March</option>
|
||||
<option value="4">April</option>
|
||||
<option value="5">May</option>
|
||||
<option value="6">June</option>
|
||||
<option value="7">July</option>
|
||||
<option value="8">August</option>
|
||||
<option value="9">September</option>
|
||||
<option value="10">October</option>
|
||||
<option value="11">November</option>
|
||||
<option value="12" selected>December</option>
|
||||
</select>
|
||||
<select name="StartDateYear">
|
||||
<option value="1999">1995</option>
|
||||
<option value="1999">1996</option>
|
||||
<option value="1999">1997</option>
|
||||
<option value="1999">1998</option>
|
||||
<option value="1999">1999</option>
|
||||
<option value="2000" selected>2000</option>
|
||||
<option value="2001">2001</option>
|
||||
</select></programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,326 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.html.select.time">
|
||||
<title>html_select_time</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Nom attribut</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>prefix</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>Time_</entry>
|
||||
<entry>Par quoi pr<70>fixer la variable.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>time</entry>
|
||||
<entry>timestamp</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>current time</entry>
|
||||
<entry>Quel jour / heure utiliser.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_hours</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>true</entry>
|
||||
<entry>S'il faut afficher l'heure.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_minutes</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>true</entry>
|
||||
<entry>S'il faut afficher les minutes.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_seconds</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>true</entry>
|
||||
<entry>S'il faut afficher les secondes.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_meridian</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>true</entry>
|
||||
<entry>S'il faut afficher le m<>ridian (am/pm)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>use_24_hours</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>true</entry>
|
||||
<entry>S'il faut utiliser l'horloge 24 heure.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>minute_interval</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>1</entry>
|
||||
<entry>Intervalle des minutes dans la liste
|
||||
d<>roulante</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>second_interval</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>1</entry>
|
||||
<entry>Intervalle des secondes dans la liste
|
||||
d<>roulante</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>field_array</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>n/a</entry>
|
||||
<entry>Nom du tableau dans lequel les valeures
|
||||
seront stock<63>es.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>all_extra</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Ajoute des attributs suppl<70>mentaires aux balises
|
||||
select / input.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>hour_extra</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Ajoute des attributs suppl<70>mentaires aux balises
|
||||
select / input de l'heure.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>minute_extra</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Ajoute des attributs suppl<70>mentaires aux balises
|
||||
select / input des minutes.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>second_extra</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Ajoute des attributs suppl<70>mentaires aux balises
|
||||
select / input des secondes.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>meridian_extra</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>null</entry>
|
||||
<entry>Ajoute des attributs suppl<70>mentaires aux balises
|
||||
select / input du m<>ridian.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
html_select_time est une fonction utilisateur qui cr<63>e des listes
|
||||
d<>roulantes pour saisir une heure. Elle prends en charge l'heure,
|
||||
les minutes, les secondes et le m<>ridian.
|
||||
</para>
|
||||
<example>
|
||||
<title>html_select_time</title>
|
||||
<programlisting>
|
||||
{html_select_time use_24_hours=true}
|
||||
|
||||
|
||||
SORTIE:
|
||||
|
||||
<select name="Time_Hour">
|
||||
<option value="00">00</option>
|
||||
<option value="01">01</option>
|
||||
<option value="02">02</option>
|
||||
<option value="03">03</option>
|
||||
<option value="04">04</option>
|
||||
<option value="05">05</option>
|
||||
<option value="06">06</option>
|
||||
<option value="07">07</option>
|
||||
<option value="08">08</option>
|
||||
<option value="09" selected>09</option>
|
||||
<option value="10">10</option>
|
||||
<option value="11">11</option>
|
||||
<option value="12">12</option>
|
||||
<option value="13">13</option>
|
||||
<option value="14">14</option>
|
||||
<option value="15">15</option>
|
||||
<option value="16">16</option>
|
||||
<option value="17">17</option>
|
||||
<option value="18">18</option>
|
||||
<option value="19">19</option>
|
||||
<option value="20">20</option>
|
||||
<option value="21">21</option>
|
||||
<option value="22">22</option>
|
||||
<option value="23">23</option>
|
||||
</select>
|
||||
<select name="Time_Minute">
|
||||
<option value="00">00</option>
|
||||
<option value="01">01</option>
|
||||
<option value="02">02</option>
|
||||
<option value="03">03</option>
|
||||
<option value="04">04</option>
|
||||
<option value="05">05</option>
|
||||
<option value="06">06</option>
|
||||
<option value="07">07</option>
|
||||
<option value="08">08</option>
|
||||
<option value="09">09</option>
|
||||
<option value="10">10</option>
|
||||
<option value="11">11</option>
|
||||
<option value="12">12</option>
|
||||
<option value="13">13</option>
|
||||
<option value="14">14</option>
|
||||
<option value="15">15</option>
|
||||
<option value="16">16</option>
|
||||
<option value="17">17</option>
|
||||
<option value="18">18</option>
|
||||
<option value="19">19</option>
|
||||
<option value="20" selected>20</option>
|
||||
<option value="21">21</option>
|
||||
<option value="22">22</option>
|
||||
<option value="23">23</option>
|
||||
<option value="24">24</option>
|
||||
<option value="25">25</option>
|
||||
<option value="26">26</option>
|
||||
<option value="27">27</option>
|
||||
<option value="28">28</option>
|
||||
<option value="29">29</option>
|
||||
<option value="30">30</option>
|
||||
<option value="31">31</option>
|
||||
<option value="32">32</option>
|
||||
<option value="33">33</option>
|
||||
<option value="34">34</option>
|
||||
<option value="35">35</option>
|
||||
<option value="36">36</option>
|
||||
<option value="37">37</option>
|
||||
<option value="38">38</option>
|
||||
<option value="39">39</option>
|
||||
<option value="40">40</option>
|
||||
<option value="41">41</option>
|
||||
<option value="42">42</option>
|
||||
<option value="43">43</option>
|
||||
<option value="44">44</option>
|
||||
<option value="45">45</option>
|
||||
<option value="46">46</option>
|
||||
<option value="47">47</option>
|
||||
<option value="48">48</option>
|
||||
<option value="49">49</option>
|
||||
<option value="50">50</option>
|
||||
<option value="51">51</option>
|
||||
<option value="52">52</option>
|
||||
<option value="53">53</option>
|
||||
<option value="54">54</option>
|
||||
<option value="55">55</option>
|
||||
<option value="56">56</option>
|
||||
<option value="57">57</option>
|
||||
<option value="58">58</option>
|
||||
<option value="59">59</option>
|
||||
</select>
|
||||
<select name="Time_Second">
|
||||
<option value="00">00</option>
|
||||
<option value="01">01</option>
|
||||
<option value="02">02</option>
|
||||
<option value="03">03</option>
|
||||
<option value="04">04</option>
|
||||
<option value="05">05</option>
|
||||
<option value="06">06</option>
|
||||
<option value="07">07</option>
|
||||
<option value="08">08</option>
|
||||
<option value="09">09</option>
|
||||
<option value="10">10</option>
|
||||
<option value="11">11</option>
|
||||
<option value="12">12</option>
|
||||
<option value="13">13</option>
|
||||
<option value="14">14</option>
|
||||
<option value="15">15</option>
|
||||
<option value="16">16</option>
|
||||
<option value="17">17</option>
|
||||
<option value="18">18</option>
|
||||
<option value="19">19</option>
|
||||
<option value="20">20</option>
|
||||
<option value="21">21</option>
|
||||
<option value="22">22</option>
|
||||
<option value="23" selected>23</option>
|
||||
<option value="24">24</option>
|
||||
<option value="25">25</option>
|
||||
<option value="26">26</option>
|
||||
<option value="27">27</option>
|
||||
<option value="28">28</option>
|
||||
<option value="29">29</option>
|
||||
<option value="30">30</option>
|
||||
<option value="31">31</option>
|
||||
<option value="32">32</option>
|
||||
<option value="33">33</option>
|
||||
<option value="34">34</option>
|
||||
<option value="35">35</option>
|
||||
<option value="36">36</option>
|
||||
<option value="37">37</option>
|
||||
<option value="38">38</option>
|
||||
<option value="39">39</option>
|
||||
<option value="40">40</option>
|
||||
<option value="41">41</option>
|
||||
<option value="42">42</option>
|
||||
<option value="43">43</option>
|
||||
<option value="44">44</option>
|
||||
<option value="45">45</option>
|
||||
<option value="46">46</option>
|
||||
<option value="47">47</option>
|
||||
<option value="48">48</option>
|
||||
<option value="49">49</option>
|
||||
<option value="50">50</option>
|
||||
<option value="51">51</option>
|
||||
<option value="52">52</option>
|
||||
<option value="53">53</option>
|
||||
<option value="54">54</option>
|
||||
<option value="55">55</option>
|
||||
<option value="56">56</option>
|
||||
<option value="57">57</option>
|
||||
<option value="58">58</option>
|
||||
<option value="59">59</option>
|
||||
</select>
|
||||
<select name="Time_Meridian">
|
||||
<option value="am" selected>AM</option>
|
||||
<option value="pm">PM</option>
|
||||
</select></programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,136 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.html.table">
|
||||
<title>html_table</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Nom attribut</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>loop</entry>
|
||||
<entry>array</entry>
|
||||
<entry>Oui</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Tableau de donn<6E>es <20> parcourir</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>cols</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>3</emphasis></entry>
|
||||
<entry>Nombre de colonnes du tableau</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>table_attr</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>border="1"</emphasis></entry>
|
||||
<entry>attributs pour la balise table</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>tr_attr</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>attributs pour les balises tr (les tableaux sont
|
||||
parcourus)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>td_attr</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>attributs pour les balises td (les tableaux sont
|
||||
parcourus)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>trailpad</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>&nbsp;</emphasis></entry>
|
||||
<entry>valeur avec laquelle remplir les cellules
|
||||
restantes de la derni<6E>re ligne (si il y en a)</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
<emphasis>html_table</emphasis> est une fonction utilisateur
|
||||
qui transforme un tableau de donn<6E>es dans un tabeau HTML. L'attribut
|
||||
<emphasis>cols</emphasis> d<>termine le nombre de colonne du tableau.
|
||||
Les attributs <emphasis>table_attr</emphasis>, <emphasis>tr_attr</emphasis>
|
||||
et <emphasis>td_attr</emphasis> d<>terminent les attributs donn<6E>s aux
|
||||
balises table, tr et td. Si <emphasis>tr_attr</emphasis> ou
|
||||
<emphasis>td_attr</emphasis> sont des tableaux, ils seront parcourus.
|
||||
<emphasis>trailpad</emphasis> est la valeur avec laquelle remplir
|
||||
les cellules restantes de la derni<6E>re ligne, s'il y en a une.
|
||||
</para>
|
||||
<example>
|
||||
<title>html_table</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
require('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('data',array(1,2,3,4,5,6,7,8,9));
|
||||
$smarty->assign('tr',array('bgcolor="#eeeeee"','bgcolor="#dddddd"'));
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
{html_table loop=$data}
|
||||
{html_table loop=$data cols=4 table_attr='border="0"'}
|
||||
{html_table loop=$data cols=4 tr_attr=$tr}
|
||||
|
||||
SORTIE:
|
||||
|
||||
<table border="1">
|
||||
<tr><td>1</td><td>2</td><td>3</td></tr>
|
||||
<tr><td>4</td><td>5</td><td>6</td></tr>
|
||||
<tr><td>7</td><td>8</td><td>9</td></tr>
|
||||
</table>
|
||||
<table border="0">
|
||||
<tr><td>1</td><td>2</td><td>3</td><td>4</td></tr>
|
||||
<tr><td>5</td><td>6</td><td>7</td><td>8</td></tr>
|
||||
<tr><td>9</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
|
||||
</table>
|
||||
<table border="1">
|
||||
<tr bgcolor="#eeeeee"><td>1</td><td>2</td><td>3</td><td>4</td></tr>
|
||||
<tr bgcolor="#dddddd"><td>5</td><td>6</td><td>7</td><td>8</td></tr>
|
||||
<tr bgcolor="#eeeeee"><td>9</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
|
||||
</table></programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,152 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.mailto">
|
||||
<title>mailto</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Nom attribut</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>address</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Oui</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>l'adresse email</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>text</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>le texte <20> afficher, par d<>faut l'adresse email</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>encode</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>none</emphasis></entry>
|
||||
<entry>Comment encoder l'adresse email.
|
||||
none, hex et javascript sont des valeurs correctes.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>cc</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Les adresses email en copie (Cc).
|
||||
S<>parez les entr<74>es par une virgule.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>bcc</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Les adresses email en copie cach<63>es (Bcc).
|
||||
S<>parez les entr<74>es par une virgule.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>subject</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Sujet de l'email.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>newsgroups</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>newsgroup ou poster le message.
|
||||
S<>parez les entr<74>es par une virgule.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>followupto</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Adresses ou transmettre le message.
|
||||
S<>parez les entr<74>es par une virgule.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>extra</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Toute information que vous souhaitez passer au lien,
|
||||
comme par exemple une classe css.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
mailto cr<63>e un lien mailto automatiquement encod<6F> (optionnel).
|
||||
L'encodage rend la t<>che de r<>cup<75>ration des e-mails sur votre
|
||||
site plus difficiles aux "web spiders".
|
||||
</para>
|
||||
<note>
|
||||
<title>Note technique</title>
|
||||
<para>
|
||||
javascript n'est certainement pas la forme d'encodage la plus robuste.
|
||||
Vous pouvez <20>galement utiliser un encodage hexad<61>cimal.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>mailto</title>
|
||||
<programlisting>
|
||||
{mailto address="me@domain.com"}
|
||||
{mailto address="moi@domaine.com" text="send me some mail"}
|
||||
{mailto address="moi@domaine.com" encode="javascript"}
|
||||
{mailto address="moi@domaine.com" encode="hex"}
|
||||
{mailto address="moi@domaine.com" subject="Hello to you!"}
|
||||
{mailto address="moi@domaine.com" cc="you@domain.com,they@domain.com"}
|
||||
{mailto address="moi@domaine.com" extra='class="email"'}
|
||||
|
||||
SORTIE:
|
||||
|
||||
<a href="mailto:moi@domaine.com" >moi@domaine.com</a>
|
||||
<a href="mailto:moi@domaine.com" >send me some mail</a>
|
||||
<SCRIPT language="javascript">eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%6
|
||||
9%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%6d%65%40%64%6f%6d%
|
||||
61%69%6e%2e%63%6f%6d%22%20%3e%6d%65%40%64%6f%6d%61%69%6e%2e%63%6f%6d%3c%2f%61%3e
|
||||
%27%29%3b'))</SCRIPT>
|
||||
<a href="mailto:%6d%65@%64%6f%6d%61%69%6e.%63%6f%6d" >&#x6d;&#x65;&#x40;&#x64;&
|
||||
#x6f;&#x6d;&#x61;&#x69;&#x6e;&#x2e;&#x63;&#x6f;&#x6d;</a>
|
||||
<a href="mailto:moi@domaine.com?subject=Hello%20to%20you%21" >moi@domaine.com</a>
|
||||
<a href="mailto:moi@domaine.com?cc=you@domain.com%2Cthey@domain.com" >moi@domaine.com</a>
|
||||
<a href="mailto:moi@domaine.com" class="email">moi@domaine.com</a></programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,150 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.math">
|
||||
<title>math</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Nom attribut</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>equation</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Oui</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>L'op<6F>ration <20> <20>x<EFBFBD>cuter</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>format</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Le format du r<>sultat (sprintf)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>var</entry>
|
||||
<entry>numeric</entry>
|
||||
<entry>Oui</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Les variables de l'op<6F>ration</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Variable de template dans laquelle la sortie
|
||||
sera assign<67>e</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>[var ...]</entry>
|
||||
<entry>numeric</entry>
|
||||
<entry>Oui</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Valeurs des variables de l'op<6F>ration</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
math autorise les designers de templates <20> effectuer des op<6F>rations
|
||||
dans le template. Toute valeur num<75>rique peut <20>tre utilis<69>e dans une
|
||||
op<6F>ration, et le r<>sultat sera affich<63> <20> la place des balises
|
||||
"equation". Les variables utilis<69>es dans l'op<6F>ration sont pass<73>es en
|
||||
tant que param<61>tre, et peuvent <20>tre des variables de templates ou des
|
||||
valeurs statiques. +, -, /, *, abs, ceil, cos,
|
||||
exp, floor, log, log10, max, min, pi, pow, rand, round, sin, sqrt,
|
||||
srans et tan sont tous des op<6F>rateurs valides. Voir la
|
||||
documentation PHP pour plus d'informations sur ces fonctions
|
||||
math<74>matiques.
|
||||
</para>
|
||||
<para>
|
||||
Si vous sp<73>cifiez l'attribut assign, la sortie sera assign<67>e <20> la variable
|
||||
donn<6E>e plut<75>t que d'<27>tre directement affich<63>e.
|
||||
</para>
|
||||
<note>
|
||||
<title>Note technique</title>
|
||||
<para>
|
||||
math est une fonction co<63>teuse en terme de performances, du fait
|
||||
qu'elle utilise la fonction PHP eval (). Effectuer les calculs
|
||||
dans votre code PHP est beaucoup plus efficient, donc, chaque fois
|
||||
que possible, effectuez vos calculs directement dans PHP et assignez
|
||||
le r<>sultat au template. Evitez co<63>t que co<63>t les appels
|
||||
r<>p<EFBFBD>titifs <20> la fonction math, comme on pourait le faire une
|
||||
une boucle section.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>math</title>
|
||||
<programlisting>
|
||||
{* $height=4, $width=5 *}
|
||||
|
||||
{math equation="x + y" x=$height y=$width}
|
||||
|
||||
SORTIE:
|
||||
|
||||
9
|
||||
|
||||
|
||||
{* $row_height = 10, $row_width = 20, #col_div# = 2, assigned in template *}
|
||||
|
||||
{math equation="height * width / division"
|
||||
height=$row_height
|
||||
width=$row_width
|
||||
division=#col_div#}
|
||||
|
||||
SORTIE:
|
||||
|
||||
100
|
||||
|
||||
|
||||
{* vous pouvez utiliser des parenth<74>ses *}
|
||||
|
||||
{math equation="(( x + y ) / z )" x=2 y=10 z=2}
|
||||
|
||||
SORTIE:
|
||||
|
||||
6
|
||||
|
||||
|
||||
{* vous pouvez d<>finir un format sprintf pour l'affichage *}
|
||||
|
||||
{math equation="x + y" x=4.4444 y=5.0000 format="%.2f"}
|
||||
|
||||
SORTIE:
|
||||
|
||||
9.44</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.popup.init">
|
||||
<title>popup_init</title>
|
||||
<para>
|
||||
popup est une int<6E>gration de overLib, une librairie capable de r<>aliser
|
||||
des fen<65>tres surgissantes. (nous parlerons de "popup").
|
||||
Ce type de fen<65>tre est utilis<69> pour apporter des informations
|
||||
contextuelles, comme des infobulles d'aides ou astuces.
|
||||
popup_init doit <20>tre appel<65> une fois, en d<>but de page si vous comptez
|
||||
utiliser la fonction <link linkend="language.function.popup">popup</link>.
|
||||
overLib <20> <20>t<EFBFBD> <20>crit par Erik Bosrup. Le site d'overlib est situ<74> <20>
|
||||
l'adresse http://www.bosrup.com/web/overlib/.
|
||||
</para>
|
||||
<para>
|
||||
Comme dans Smarty 2.1.2, overLib n'est PAS fournie dans la distribution.
|
||||
T<>l<EFBFBD>chargez overLib, d<>posez overlib.js dans votre arborescence web et
|
||||
indiquez le chemin relatif <20> ce fichier dans l'attribut src de
|
||||
popup_init.
|
||||
</para>
|
||||
<example>
|
||||
<title>popup_init</title>
|
||||
<programlisting>
|
||||
{* popup_init doit <20>tre appel<65> une fois en d<>but de page. *}
|
||||
{popup_init src="/javascripts/overlib.js"}</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,443 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.popup">
|
||||
<title>popup</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Nom attribut</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>text</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Oui</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>le texte/code html <20> afficher dans la popup</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>trigger</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>onMouseOver</emphasis></entry>
|
||||
<entry>L'<27>v<EFBFBD>nement utilis<69> pour rendre la popup active,
|
||||
onMouseOver ou onClick.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>sticky</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>false</emphasis></entry>
|
||||
<entry>Rends la popup active jusqu'a ce qu'elle soit
|
||||
explicitement ferm<72>e.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>caption</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>D<EFBFBD>fini le libell<6C> du titre</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>fgcolor</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>couleur interne de la popup</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>bgcolor</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>couleur de la bordure de la popup</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>textcolor</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>couleur du texte <20> l'int<6E>rieur de la
|
||||
popup</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>capcolor</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>couleur du libell<6C> de la popup</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>closecolor</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>couleur du texte de fermeture</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>textfont</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>la police <20> utiliser dans le texte principal</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>captionfont</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>la police <20> utiliser dans le libell<6C></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>closefont</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>la police pour le texte de fermeture</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>textsize</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>taille de la police texte prinicpal</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>captionsize</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>taille de la police du libell<6C></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>closesize</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>taille de la police du bouton "fermer"</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>width</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Longeur de la popup</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>height</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Hauteur de la popup</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>left</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>false</emphasis></entry>
|
||||
<entry>la popup va <20> gauche de la souris</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>right</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>false</emphasis></entry>
|
||||
<entry>la popup va <20> droite de la souris</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>center</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>false</emphasis></entry>
|
||||
<entry>la popup est centr<74>e par rapport <20> la
|
||||
position de la souris</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>above</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>false</emphasis></entry>
|
||||
<entry>la popup est au dessus de la souris. NOTE:
|
||||
possible uniquement si la hauteur est d<>finie</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>below</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>false</emphasis></entry>
|
||||
<entry>la popup apparait en dessous de la souris</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>border</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>rends la bordure de la popup plus <20>paisse ou plus
|
||||
fine</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>offsetx</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>A quelle distance du curseur la popup apparaitra
|
||||
, horizontalement.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>offsety</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>A quelle distance du curseur la popup apparaitra
|
||||
, verticalement.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>fgbackground</entry>
|
||||
<entry>url to image</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Une image <20> utiliser <20> la place de la couleur de
|
||||
fonds dans la popup</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>bgbackground</entry>
|
||||
<entry>url to image</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Image <20> utiliser <20> la place de la bordure de la
|
||||
popup. NOTE: vous veillerez <20> d<>finir bgcolor <20> "" ou la
|
||||
couleur apparaitra de m<>me. NOTE: Lorsque vous avez un
|
||||
lien de fermeture, Netscape effectuera un nouveau rendu
|
||||
des cellules du tableau, affichant mal les <20>l<EFBFBD>ments</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>closetext</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>d<EFBFBD>finit le texte de fermeture par autre chose
|
||||
que "Close"</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>noclose</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>N'affiche pas le bouton "Close" pour les fen<65>tres
|
||||
"collantes".
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>status</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>d<EFBFBD>fini le texte de la barre de statut
|
||||
du navigateur</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>autostatus</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>D<EFBFBD>fini le texte de la barre de statut au contenu
|
||||
de la popup. NOTE: Ecrase l'attribut status.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>autostatuscap</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>D<EFBFBD>fini le texte de la barre de statut au libell<6C>
|
||||
de la popup. NOTE: Ecrase l'attribut status.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>inarray</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>indique <20> overLib de lire le texte <20> cet index dans le
|
||||
tableau ol_text, situ<74> dans overlib.js. Ce param<61>tre peut <20>tre
|
||||
utilis<69> <20> la place de text.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>caparray</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>indique <20> overlib de lire le libell<6C> depuis le
|
||||
tableau ol_caps</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>capicon</entry>
|
||||
<entry>url</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>affiche l'image sp<73>cifi<66>e avant le libell<6C> de la
|
||||
popup</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>snapx</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Aligne la popup sur une grille horizontale</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>snapy</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Aligne la popup sur une grille verticale</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>fixx</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>v<EFBFBD>rrouille la popup <20> une position horizontale.
|
||||
Note: remplace les autres param<61>tres de position
|
||||
horizontale</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>fixy</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>v<EFBFBD>rouille la popup <20> une position verticale
|
||||
Note: remplace les autres param<61>tres de position
|
||||
verticale</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>background</entry>
|
||||
<entry>url</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>d<EFBFBD>fini l'image <20> utiliser plut<75>t que le tableau
|
||||
de fond</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>padx</entry>
|
||||
<entry>integer,integer</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry><EFBFBD>carte l'image de fond du reste des <20>l<EFBFBD>ments
|
||||
avec un espace horizontal, pour le positionnement du texte.
|
||||
Note: c'est un attribut <20> deux param<61>tres.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>pady</entry>
|
||||
<entry>integer,integer</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry><EFBFBD>carte l'image de fond du reste des <20>l<EFBFBD>ments
|
||||
avec un espace vertical, pour le positionnement du texte.
|
||||
Note: c'est un attribut <20> deux param<61>tres.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>fullhtml</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>vous autorise <20> placer du code html en tant que
|
||||
contenu de la popup. Le code html est attendu dans
|
||||
l'attribut text.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>frame</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>contr<EFBFBD>le la popup dans un cadre diff<66>rent.
|
||||
Voir la documentation d'overlib pour plus de d<>tails
|
||||
sur cette fonction.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>timeout</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Appelle la fonction javascript sp<73>cifi<66>e et prends
|
||||
sa valeur de retour comme texte devant <20>tre affich<63>
|
||||
dans la popup.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>delay</entry>
|
||||
<entry>integer</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>la popup se comporte comme une infobulle.
|
||||
Elle disparaitra au bout d'un certain d<>lai, en
|
||||
millisecondes.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>hauto</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>D<EFBFBD>termine automatiquement si la popup doit <20>tre
|
||||
<20> gauche ou <20> droite de la souris</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>vauto</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>D<EFBFBD>termine automatiquement si la popup doit <20>tre
|
||||
au-dessus ou au-dessous de la souris</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
popup est utilis<69> pour cr<63>er une fen<65>tre popup javascript.
|
||||
</para>
|
||||
<example>
|
||||
<title>popup</title>
|
||||
<programlisting>
|
||||
{* popup_init doit <20>tre appel<65> en haut de votre page *}
|
||||
{popup_init src="/javascripts/overlib.js"}
|
||||
|
||||
{* cr<63>ation d'un lien avec une popup qui apparait sur l'<27>v<EFBFBD>nement onMouseOver *}
|
||||
<A href="mypage.html" {popup text="Ce lien vous am<61>ne sur ma page!"}>mypage</A>
|
||||
|
||||
{* vous pouvez utiliser du html, des liens, etc dans vos popup *}
|
||||
<A href="mypage.html" {popup sticky=true caption="mypage contents"
|
||||
text="<UL><LI>links<LI>pages<LI>images</UL>" snapx=10 snapy=10}>mypage</A>
|
||||
|
||||
SORTIE:
|
||||
|
||||
(allez sur le site officiel de Smarty pour des exemples.)</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,260 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.textformat">
|
||||
<title>textformat</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Nom attribut</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>style</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>style pr<70>d<EFBFBD>fini</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>indent</entry>
|
||||
<entry>number</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>0</emphasis></entry>
|
||||
<entry>Taille de l'indentation pour chaque
|
||||
ligne</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>indent_first</entry>
|
||||
<entry>number</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>0</emphasis></entry>
|
||||
<entry>Taille de l'indentation de la
|
||||
premi<6D>re ligne</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>indent_char</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>(single space)</emphasis></entry>
|
||||
<entry>Le caract<63>re (ou la cha<68>ne) <20> utiliser pour
|
||||
indenter</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>wrap</entry>
|
||||
<entry>number</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>80</emphasis></entry>
|
||||
<entry>A combien de caract<63>res doit on ajuster chaque
|
||||
ligne</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>wrap_char</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>\n</emphasis></entry>
|
||||
<entry>Le caract<63>re (ou cha<68>ne de caract<63>res) avec lequel
|
||||
terminer les lignes</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>wrap_cut</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>false</emphasis></entry>
|
||||
<entry>Si true, wrap r<>duira les lignes au caract<63>re exact
|
||||
au lieu d'ajuster <20> la fin d'un mot</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>assign</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Le nom de la variable PHP dans laquelle la
|
||||
sortie sera assign<67>e</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
textformat est une fonction de bloc utilis<69>e pour formater du texte.
|
||||
Elle nettoie la cha<68>ne de ses espaces et caract<63>res sp<73>ciaux, puis
|
||||
formate les paragraphes en ajustant ces derniers <20> une certaine limite,
|
||||
puis en indentant les lignes.
|
||||
</para>
|
||||
<para>
|
||||
Vous pouvez soit utiliser un style pr<70>d<EFBFBD>fini, soit d<>finir explicitement
|
||||
chaque attribut. Actuellement, seul le style pr<70>d<EFBFBD>fini "email" est
|
||||
disponible.
|
||||
</para>
|
||||
<example>
|
||||
<title>textformat</title>
|
||||
<programlisting>
|
||||
{textformat wrap=40}
|
||||
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
|
||||
This is bar.
|
||||
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
|
||||
{/textformat}
|
||||
|
||||
SORTIE:
|
||||
|
||||
This is foo. This is foo. This is foo.
|
||||
This is foo. This is foo. This is foo.
|
||||
|
||||
This is bar.
|
||||
|
||||
bar foo bar foo foo. bar foo bar foo
|
||||
foo. bar foo bar foo foo. bar foo bar
|
||||
foo foo. bar foo bar foo foo. bar foo
|
||||
bar foo foo. bar foo bar foo foo.
|
||||
|
||||
|
||||
{textformat wrap=40 indent=4}
|
||||
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
|
||||
This is bar.
|
||||
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
|
||||
{/textformat}
|
||||
|
||||
SORTIE:
|
||||
|
||||
This is foo. This is foo. This is
|
||||
foo. This is foo. This is foo. This
|
||||
is foo.
|
||||
|
||||
This is bar.
|
||||
|
||||
bar foo bar foo foo. bar foo bar foo
|
||||
foo. bar foo bar foo foo. bar foo
|
||||
bar foo foo. bar foo bar foo foo.
|
||||
bar foo bar foo foo. bar foo bar
|
||||
foo foo.
|
||||
|
||||
{textformat wrap=40 indent=4 indent_first=4}
|
||||
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
|
||||
This is bar.
|
||||
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
|
||||
{/textformat}
|
||||
|
||||
SORTIE:
|
||||
|
||||
This is foo. This is foo. This
|
||||
is foo. This is foo. This is foo.
|
||||
This is foo.
|
||||
|
||||
This is bar.
|
||||
|
||||
bar foo bar foo foo. bar foo bar
|
||||
foo foo. bar foo bar foo foo. bar
|
||||
foo bar foo foo. bar foo bar foo
|
||||
foo. bar foo bar foo foo. bar foo
|
||||
bar foo foo.
|
||||
|
||||
{textformat style="email"}
|
||||
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
This is foo.
|
||||
|
||||
This is bar.
|
||||
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
bar foo bar foo foo.
|
||||
|
||||
{/textformat}
|
||||
|
||||
SORTIE:
|
||||
|
||||
This is foo. This is foo. This is foo. This is foo. This is foo. This is
|
||||
foo.
|
||||
|
||||
This is bar.
|
||||
|
||||
bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo
|
||||
bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo
|
||||
foo.
|
||||
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.capitalize">
|
||||
<title>capitalize</title>
|
||||
<para>
|
||||
Met la premi<6D>re lettre de chaque mot d'une variable en majuscule.
|
||||
</para>
|
||||
<example>
|
||||
<title>capitalize</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('titreArticle', 'La police commence une campagne de sensibilisation contre la violence routi<74>re.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
{$titreArticle}
|
||||
{$titreArticle|capitalize}
|
||||
|
||||
SORTIE:
|
||||
|
||||
La police commence une campagne de sensibilisation contre la violence routi<74>re.
|
||||
La Police Commence Une Campagne De Sensibilisation Contre La Violence Routi<74>re.</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.cat">
|
||||
<title>cat</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="cat" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Position du param<61>tre</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>cat</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>Valeur <20> concat<61>ner <20> la variable donn<6E>e.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Cette valeur est concat<61>n<EFBFBD>e <20> la variable donn<6E>e.
|
||||
</para>
|
||||
<example>
|
||||
<title>cat</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('TitreArticle', 'Les devins ont pr<70>vus que le monde existera toujours ');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
{$TitreArticle|cat:" demain."}
|
||||
|
||||
SORTIE:
|
||||
|
||||
Les devins ont pr<70>vus que le monde existera toujours demain.</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.count.characters">
|
||||
<title>count_characters</title>
|
||||
<para>
|
||||
Compte le nombre de caract<63>res dans une variable.
|
||||
</para>
|
||||
<example>
|
||||
<title>count_characters</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('titreArticle', 'Vagues de froid li<6C>es <20> la temp<6D>rature.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
{$titreArticle}
|
||||
{$titreArticle|count_characters}
|
||||
|
||||
SORTIE:
|
||||
|
||||
Vagues de froid li<6C>es <20> la temp<6D>rature.
|
||||
39
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.count.paragraphs">
|
||||
<title>count_paragraphs</title>
|
||||
<para>
|
||||
Compte le nombre de paragraphes dans une variable.
|
||||
</para>
|
||||
<example>
|
||||
<title>count_paragraphs</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('TitreArticle', 'La guerre apporte la paix, au prix de la vie de certains innocents.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
{$TitreArticle}
|
||||
{$TitreArticle|count_paragraphs}
|
||||
|
||||
SORTIE:
|
||||
|
||||
La guerre apporte la paix, au prix de la vie des innocents.
|
||||
1</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.count.sentences">
|
||||
<title>count_sentences</title>
|
||||
<para>
|
||||
Compte le nombre de phrases dans une variable.
|
||||
</para>
|
||||
<example>
|
||||
<title>count_sentences</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('TitreArticle', 'Deux navires rentrent en
|
||||
collision - Un des deux coule. Des vaches enrag<61>es blessent un fermier <20>
|
||||
coups de haches.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
{$TitreArticle}
|
||||
{$TitreArticle|count_sentences}
|
||||
|
||||
SORTIE:
|
||||
Deux navires rentrent en collision
|
||||
- Un des deux coule. Des vaches enrag<61>es blessent un fermier
|
||||
<EFBFBD> coups de haches.
|
||||
|
||||
2</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.count.words">
|
||||
<title>count_words</title>
|
||||
<para>
|
||||
Compte le nombre de mots dans une variable.
|
||||
</para>
|
||||
<example>
|
||||
<title>count_words</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('TitreArticle', 'Un anneau pour les gouverner tous.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
{$titreArticle}
|
||||
{$titreArticle|count_words}
|
||||
|
||||
SORTIE:
|
||||
|
||||
Un anneau pour les gouverner tous.
|
||||
6</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,187 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.date.format">
|
||||
<title>date_format</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Position du param<61>tre</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>%b %e, %Y</entry>
|
||||
<entry>Format de sortie de la date.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>2</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>n/a</entry>
|
||||
<entry>Date par d<>faut si aucune n'est sp<73>cifi<66>e en entr<74>e.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Formate une date / heure au format strftime donn<6E>. Les dates peuvent
|
||||
<20>tre pass<73>es <20> smarty en tant que timestamp unix, timestamp mysql ou
|
||||
comme cha<68>ne quelconque contenant mois jour ann<6E>e (interpr<70>table par
|
||||
strtotime). Les concepteurs de templates peuvent utiliser date_format
|
||||
pour contr<74>ler parfaitement le format de sortie de la date.
|
||||
Si la date pass<73>e <20> date_format est vide, et qu'un second param<61>tre
|
||||
est donn<6E>, ce dernier sera utilis<69> comme <20>tant la date <20> formater.
|
||||
</para>
|
||||
<example>
|
||||
<title>date_format</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('hier', strtotime('-1 day'));
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
|
||||
{$smarty.now|date_format}
|
||||
{$smarty.now|date_format:"%A, %B %e, %Y"}
|
||||
{$smarty.now|date_format:"%H:%M:%S"}
|
||||
{$hier|date_format}
|
||||
{$hier|date_format:"%A, %B %e, %Y"}
|
||||
{$hier|date_format:"%H:%M:%S"}
|
||||
|
||||
SORTIE:
|
||||
|
||||
Feb 6, 2001
|
||||
Tuesday, February 6, 2001
|
||||
14:33:00
|
||||
Feb 5, 2001
|
||||
Monday, February 5, 2001
|
||||
14:33:00</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>date_format indicateurs de convertion</title>
|
||||
<programlisting>
|
||||
%a - Abr<62>viation du jour de la semaine, selon les param<61>tres locaux.
|
||||
|
||||
%A - Nom du jour de la semaine, selon les param<61>tres locaux.
|
||||
|
||||
%b - Abr<62>viation du nom du jour, selon les param<61>tres locaux.
|
||||
|
||||
%B - Nom complet du mois, selon les param<61>tres locaux.
|
||||
|
||||
%c - Pr<50>f<EFBFBD>rences d'affichage selon les param<61>tres locaux.
|
||||
|
||||
%C - Si<53>cle, (L'ann<6E>e divis<69>e par 100 et tronqu<71>e comme un entier, de 00 <20> 99)
|
||||
|
||||
%d - Jour du mois, en tant que nombre d<>cimal (de 00 <20> 31)
|
||||
|
||||
%D - m<>me chose que %m/%d/%y
|
||||
|
||||
%e - Jour du mois en tant que nombre d<>cimal. Un chiffre unique est pr<70>c<EFBFBD>d<EFBFBD> par
|
||||
un espace (de 1 <20> 31)
|
||||
|
||||
%g - Position de la semaine dans le si<73>cle [00,99]
|
||||
|
||||
%G - Position de la semaine, incluant le si<73>cle [0000,9999]
|
||||
|
||||
%h - identique <20> %b
|
||||
|
||||
%H - L'heure en tant que d<>cimale, en utilisant une horloge sur 24 (de 00 <20> 23)
|
||||
|
||||
%I - L'heure en tant que d<>cimale en utilisant une horloge sur 12 (de 01 to 12)
|
||||
|
||||
%j - jour de l'ann<6E>e (de 001 <20> 366)
|
||||
|
||||
%k - Heure (horloge sur 24). Les num<75>ros <20> un chiffre sont pr<70>c<EFBFBD>d<EFBFBD>s d'un espace. (de 0 <20> 23)
|
||||
|
||||
%l - Heure (horloge sur 12). Les num<75>ros <20> un chiffre sont pr<70>c<EFBFBD>d<EFBFBD>s d'un espace. (de 1 <20> 12)
|
||||
|
||||
%m - Mois en tant que nombre d<>cimal (de 01 <20> 12)
|
||||
|
||||
%M - Minute en tant que nombre d<>cimal
|
||||
|
||||
%n - Retour chariot (nouvelle ligne).
|
||||
|
||||
%p - soit am soit pm selon l'heure donn<6E>e, ou alors leurs correspondances locales.
|
||||
|
||||
%r - heure en notation a.m. et p.m.
|
||||
|
||||
%R - Heure au format 24 heures
|
||||
|
||||
%S - Secondes en tant que nombre d<>cimal.
|
||||
|
||||
%t - Caract<63>re tabulation.
|
||||
|
||||
%T - Heure courante, <20>quivalent <20> %H:%M:%S
|
||||
|
||||
%u - Jour de la semaine en tant que nombre d<>cimal [1,7], ou 1 repr<70>sente le lundi.
|
||||
|
||||
%U - Le num<75>ro de la semaine en nombre d<>cimal, utilisant le premier dimanche
|
||||
en tant que premier jour de la premi<6D>re semaine.
|
||||
|
||||
%V - Le num<75>ro de la semaine de l'ann<6E>e courante selon la norme ISO 8601:1988,
|
||||
de 01 <20> 53, ou la semaine 1 est la premi<6D>re semaine qui dispose au minimum
|
||||
de 4 jours dans l'ann<6E>e courante et ou Lundi est le premier jour
|
||||
de cette semaine.
|
||||
|
||||
%w - Jour de la semaine en tant que nombre d<>cimal, dimanche <20>tant 0
|
||||
|
||||
%W - Le num<75>ro de la semaine de l'ann<6E>e courante en tant que nombre d<>cimal,
|
||||
ou Lundi est le premier jour de la premi<6D>re semaine.
|
||||
|
||||
%x - Repr<70>sentation pr<70>f<EFBFBD>r<EFBFBD>e de la date selon les param<61>tres locaux.
|
||||
|
||||
%X - Repr<70>sentation pr<70>f<EFBFBD>r<EFBFBD>e de l'heure selon les param<61>tres locaux, sans la
|
||||
date.
|
||||
|
||||
%y - L'ann<6E>e en tant que nombre d<>cimal, sans le si<73>cle. (de 00 <20> 99)
|
||||
|
||||
%Y - L'ann<6E>e en tant que nombre d<>cimal, avec le si<73>cle.
|
||||
|
||||
%Z - Zone horraire, nom ou abr<62>viation
|
||||
|
||||
%% - Un caract<63>re lit<69>ral `%'
|
||||
|
||||
NOTE AUX DEVELOPPEURS: date_format est un alias de la fonction
|
||||
PHP strftime(). Il est probable que vous disposiez de plus ou moins d'options
|
||||
disponibles selon le syst<73>me sur lequel PHP a <20>t<EFBFBD> compil<69> (strftime ()).
|
||||
Reportez vous <20> l'aide de votre syst<73>me pour une liste compl<70>te des
|
||||
param<EFBFBD>tres disponibles.</programlisting>
|
||||
</example>
|
||||
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.default">
|
||||
<title>default</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Position du param<61>tre</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>empty</emphasis></entry>
|
||||
<entry>La valeur par d<>faut de la sortie si la variable
|
||||
d'entr<74>e est vide.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Utilis<69> pour d<>finir une valeur par d<>faut <20> une variable.
|
||||
Si la variable est vide ou ind<6E>finie, la valeur donn<6E>e est affich<63>e
|
||||
en lieu et place. Default attends un seul argument.
|
||||
</para>
|
||||
<example>
|
||||
<title>default</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('TitreArticle', 'Les portes de la moria restent ferm<72>es.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
{$TitreArticle|default:"pas de titre"}
|
||||
{$monTitre|default:"pas de titre"}
|
||||
|
||||
SORTIE:
|
||||
|
||||
Les portes de la moria restent ferm<72>es.
|
||||
pas de titre</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.escape">
|
||||
<title>escape</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="6">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="possible" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Position du param<61>tre</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Valeurs possibles</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>re</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>html, htmlall, url, quotes, hex, hexentity,
|
||||
javascript</entry>
|
||||
<entry>html</entry>
|
||||
<entry>Format d'<27>chappement <20> utiliser.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
"Echappe" les caract<63>res sp<73>ciaux html, d'url, pour
|
||||
les quotes d'une cha<68>ne, les valeurs
|
||||
hexad<61>cimales, les entit<69>s hexad<61>cimales ou javascript.
|
||||
Par d<>faut, ce param<61>tre est html.
|
||||
</para>
|
||||
<example>
|
||||
<title>escape</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('TitreArticle', "'Stiff Opposition Expected to Casketless Funeral Plan'");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
{$titreArticle}
|
||||
{$titreArticle|escape}
|
||||
{$titreArticle|escape:"html"} {* escapes & " ' < > *}
|
||||
{$titreArticle|escape:"htmlall"} {* escapes ALL html entities *}
|
||||
{$titreArticle|escape:"url"}
|
||||
{$titreArticle|escape:"quotes"}
|
||||
<a href="mailto:{$EmailAddress|escape:"hex"}">{$EmailAddress|escape:"hexentity"}</a>
|
||||
|
||||
SORTIE:
|
||||
|
||||
'Stiff Opposition Expected to Casketless Funeral Plan'
|
||||
&#039;Stiff Opposition Expected to Casketless Funeral Plan&#039;
|
||||
&#039;Stiff Opposition Expected to Casketless Funeral Plan&#039;
|
||||
&#039;Stiff Opposition Expected to Casketless Funeral Plan&#039;
|
||||
%27Stiff+Opposition+Expected+to+Casketless+Funeral+Plan%27
|
||||
\'Stiff Opposition Expected to Casketless Funeral Plan\'
|
||||
<a href="mailto:%62%6f%62%40%6d%65%2e%6e%65%74">&#x62;&#x6f;&#x62;&#x40;&#x6d;&#x65;&#x2e;&#x6e;&#x65;&#x74;</a></programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.indent">
|
||||
<title>indent</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc"/>
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Position du param<61>tre</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>entier</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>4</entry>
|
||||
<entry>De combien de caract<63>res l'indentation doit <20>tre effectu<74>e.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>2</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>re</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>(espace)</entry>
|
||||
<entry>Caract<EFBFBD>re <20> utiliser pour l'indentation.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Indente chacune des lignes d'une cha<68>ne. Comme param<61>tre optionnel,
|
||||
vous pouvez sp<73>cifier le nombre de caract<63>res <20> utiliser pour l'indentation (4 par d<>faut).
|
||||
Comme second param<61>tre optionnel, vous
|
||||
pouvez sp<73>cifier le caract<63>re <20> utiliser pour l'indentation (utilisez
|
||||
"\t" pour les tabulations).
|
||||
</para>
|
||||
<example>
|
||||
<title>indent</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('TitreArticle', 'Il fera noir cette nuit.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
{$TitreArticle}
|
||||
|
||||
{$TitreArticle|indent}
|
||||
|
||||
{$TitreArticle|indent:10}
|
||||
|
||||
{$TitreArticle|indent:1:"\t"}
|
||||
|
||||
SORTIE:
|
||||
|
||||
Il fera noir cette nuit.
|
||||
|
||||
Il fera noir cette nuit.
|
||||
|
||||
Il fera noir cette nuit.
|
||||
|
||||
Il fera noir cette nuit.
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.lower">
|
||||
<title>lower</title>
|
||||
<para>
|
||||
Met une variable en minuscules.
|
||||
</para>
|
||||
<example>
|
||||
<title>lower</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('TitreArticle', 'Deux Suspects Se Sont Sauv<75>s.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
{$TitreArticle}
|
||||
{$TitreArticle|lower}
|
||||
|
||||
SORTIE:
|
||||
|
||||
Deux Suspects Se Sont Sauv<75>s.
|
||||
deux suspects se sont sauv<75>s.</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.nl2br">
|
||||
<title>nl2br</title>
|
||||
<para>
|
||||
Transforme toutes les fins de lignes en balises <br />.
|
||||
Equivalent <20> la fonction PHP nl2br().
|
||||
</para>
|
||||
<example>
|
||||
<title>nl2br</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('TitreArticle', "Pluie ou soleil attendu\naujourd'hui, nuit noire");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
{$TitreArticle|nl2br}
|
||||
|
||||
SORTIE:
|
||||
|
||||
Pluie ou soleil attendu<br />aujourd'hui, nuit noire</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.regex.replace">
|
||||
<title>regex_replace</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc"/>
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Position du param<61>tre</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>re</entry>
|
||||
<entry>Oui</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Expression r<>guli<6C>re <20> remplacer.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>2</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>re</entry>
|
||||
<entry>Oui</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>La cha<68>ne de remplacement.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Un rechercher / remplacer avec une expression r<>guli<6C>re. Utilise la m<>me
|
||||
syntaxe que la fonction PHP preg_replace.
|
||||
</para>
|
||||
<example>
|
||||
<title>regex_replace</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('TitreArticle', "L'infertilit<69> est un maux grandissant\n, disent les experts.");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
{* Remplace tous les retours chariot et les tabulation par une nouvelle ligne avec un espace *}
|
||||
|
||||
{$TitreArticle}
|
||||
{$TitreArticle|regex_replace:"/[\r\t\n]/":" "}
|
||||
|
||||
SORTIE:
|
||||
|
||||
L'infertilit<69> est un maux grandissant
|
||||
, disent les experts.
|
||||
L'infertilit<69> est un maux grandissant, disent les experts.</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.replace">
|
||||
<title>replace</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc"/>
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Position du param<61>tre</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Oui</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>cha<EFBFBD>ne <20> remplacer.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>2</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Oui</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>cha<EFBFBD>ne de remplacement.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Un simple remplacement de cha<68>ne de caract<63>res.
|
||||
</para>
|
||||
<example>
|
||||
<title>replace</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('titreArticle', "Child's Stool Great for Use in Garden.");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
{$titreArticle}
|
||||
{$titreArticle|replace:"Garden":"Vineyard"}
|
||||
{$titreArticle|replace:" ":" "}
|
||||
|
||||
SORTIE:
|
||||
|
||||
Child's Stool Great for Use in Garden.
|
||||
Child's Stool Great for Use in Vineyard.
|
||||
Child's Stool Great for Use in Garden.</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,79 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.spacify">
|
||||
<title>spacify</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc"/>
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Position du param<61>tre</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>re</entry>
|
||||
<entry>Non</entry>
|
||||
<entry><emphasis>espace</emphasis></entry>
|
||||
<entry>Ce qui est ins<6E>r<EFBFBD> entre chaque caract<63>re de la variable.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
spacify est un moyen pour ins<6E>rer un espace entre tous les caract<63>res
|
||||
d'une variable. Optionnellement, vous pouvez lui passer un caract<63>re
|
||||
(ou une cha<68>ne) diff<66>rent de espace <20> ins<6E>rer.
|
||||
</para>
|
||||
<example>
|
||||
<title>spacify</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('titreArticle', 'Quelque chose s'est mal pass<73> et <20> provoqu<71>
|
||||
cet accident, disent les experts');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
{$titreArticle}
|
||||
{$titreArticle|spacify}
|
||||
{$titreArticle|spacify:"^^"}
|
||||
|
||||
SORTIE:
|
||||
|
||||
Quelquechose s'est mal pass<73> et <20> provoqu<71> cet accident, disent les experts.
|
||||
Q u e l q u e c h o s e s ' e s t m a l p a s s <20> e t <20> p r o v o q u <20> c e t a c c i d e n t , d i s e n t l e s e x p e r t s .
|
||||
Q^^u^^e^^l^^q^^u^^e^^c^^h^^o^^s^^e^^ ^^s^^'^^e^^s^^t^^ ^^m^^a^^l^^ ^^p^^a^^s^^s^^<5E>^^ ^^e^^t^^ ^^<5E>^^ ^^p^^r^^o^^v^^o^^q^^u^^<5E>^^ ^^c^^e^^t^^ ^^a^^c^^c^^i^^d^^e^^n^^t^^,^^ ^^d^^i^^s^^e^^n^^t^^ ^^l^^e^^s^^ ^^e^^x^^p^^e^^r^^t^^s^^.</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.string.format">
|
||||
<title>string_format</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc"/>
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Position du param<61>tre</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Oui</entry>
|
||||
<entry><emphasis>n/a</emphasis></entry>
|
||||
<entry>Le format <20> utiliser (sprintf)</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Un moyen pour formater les cha<68>nes de caract<63>res, comme par exemple les
|
||||
nombres d<>cimaux. Utilise la syntaxe de sprintf pour formater les <20>l<EFBFBD>ments.
|
||||
</para>
|
||||
<example>
|
||||
<title>string_format</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('nombre', 23.5787446);
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
{$nombre}
|
||||
{$nombre|string_format:"%.2f"}
|
||||
{$nombre|string_format:"%d"}
|
||||
|
||||
SORTIE:
|
||||
|
||||
23.5787446
|
||||
23.58
|
||||
24</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.strip.tags">
|
||||
<title>strip_tags</title>
|
||||
<para>
|
||||
Supprime toutes les balises, et plus g<>n<EFBFBD>ralement tout ce qui se trouve
|
||||
entre < et >.
|
||||
</para>
|
||||
<example>
|
||||
<title>strip_tags</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('titreArticle', "Une femme aveugle obtient un nouveau <font face=\"helvetica\">
|
||||
rein</font> d'un p<>re qu'elle n'a pas vu depuis<b> des ann<6E>es</b>.");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
{$titreArticle}
|
||||
{$titreArticle|strip_tags}
|
||||
|
||||
SORTIE:
|
||||
|
||||
Une femme aveugle obtient un nouveau <font face=\"helvetica\">
|
||||
rein</font> d'un p<>re qu'elle n'a pas vu depuis<b> des ann<6E>es</b>.
|
||||
Une femme aveugle obtient un nouveau rein d'un p<>re
|
||||
qu'elle n'a pas vu depuis des ann<6E>es.</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.strip">
|
||||
<title>strip</title>
|
||||
<para>
|
||||
Remplace les espaces multiples, les nouvelles lignes et les tabulations
|
||||
par un espace simple, ou une cha<68>ne donn<6E>e.
|
||||
</para>
|
||||
<note>
|
||||
<title>Note</title>
|
||||
<para>
|
||||
Si vous voulez r<>aliser cette action sur un bloc complet du template,
|
||||
utilisez la <link
|
||||
linkend="language.function.strip">fonction strip</link>.
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>strip</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('titreArticle', "Une r<>union autour\n d'un feu de chemin<69>e\t
|
||||
est toujours agr<67>able.");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
{$titreArticle}
|
||||
{$titreArticle|strip}
|
||||
{$titreArticle|strip:"&nbsp;"}
|
||||
|
||||
SORTIE:
|
||||
|
||||
Une r<>union autour
|
||||
d'un feu de chemin<69>e est toujours agr<67>able.
|
||||
Une r<>union autour d'un feu de chemin<69>e est toujours agr<67>able.
|
||||
Une&nbsp;r<>union&nbsp;autour&nbsp;d'un&nbsp;feu&nbsp;de&nbsp;chemin<69>e&nbsp;est&nbsp;toujours
|
||||
&nbsp;agr<67>able.</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.truncate">
|
||||
<title>truncate</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc"/>
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Position du param<61>tre</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>entier</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>80</entry>
|
||||
<entry>Le nombre de caract<63>res maximums au-del<65> duquel
|
||||
on effectue le troncage</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>2</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>re</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>...</entry>
|
||||
<entry>Le texte <20> rajouter lorsque l'on effectue un
|
||||
troncage.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>3</entry>
|
||||
<entry>bool<EFBFBD>en</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>false</entry>
|
||||
<entry>D<EFBFBD>termine si le troncage est effectu<74> sur
|
||||
le dernier mot (false), ou au caract<63>re exact (true).
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Tronque une variable <20> une certaine longueur, par d<>faut 80.
|
||||
Un second param<61>tre optionnel permet de sp<73>cifier une cha<68>ne <20> afficher
|
||||
<20> la fin de la variable une fois tronqu<71>e. Les caract<63>res de fin sont
|
||||
inclus dans la longueur de la cha<68>ne <20> tronquer. Par d<>faut,
|
||||
truncate tentera de couper la cha<68>ne <20> la fin d'un mot. Si vous voulez
|
||||
tronquer la cha<68>ne au caract<63>re exact, donnez la valeur true au
|
||||
dernier param<61>tre optionnel.
|
||||
</para>
|
||||
<example>
|
||||
<title>truncate</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('titreArticle', 'Deux soeurs r<>unies apr<70>s 18 ans de s<>paration.');
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
{$titreArticle}
|
||||
{$titreArticle|truncate}
|
||||
{$titreArticle|truncate:30}
|
||||
{$titreArticle|truncate:30:""}
|
||||
{$titreArticle|truncate:30:"---"}
|
||||
{$titreArticle|truncate:30:"":true}
|
||||
{$titreArticle|truncate:30:"...":true}
|
||||
|
||||
SORTIE:
|
||||
|
||||
Deux soeurs r<>unies apr<70>s 18 ans de s<>paration.
|
||||
Deux soeurs r<>unies apr<70>s...
|
||||
Deux soeurs r<>unies apr<70>s
|
||||
Deux soeurs r<>unies apr<70>s---
|
||||
Deux soeurs r<>unies apr<70>s 18 a
|
||||
Deux soeurs r<>unies apr<70>s 1...
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.upper">
|
||||
<title>upper</title>
|
||||
<para>
|
||||
Met une variable en majuscules.
|
||||
</para>
|
||||
<example>
|
||||
<title>upper</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('titreArticle', "Si l'attaque n'est pas mise en place
|
||||
rapidement, cela risque de durer longtemps.");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
{$titreArticle}
|
||||
{$titreArticle|upper}
|
||||
|
||||
SORTIE:
|
||||
|
||||
Si l'attaque n'est pas mise en place rapidement, cela risque de durer longtemps.
|
||||
SI L'ATTAQUE N'EST PAS MISE EN PLACE RAPIDEMENT, CELA RISQUE DE DURER LONGTEMPS.</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,122 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.modifier.wordwrap">
|
||||
<title>wordwrap</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc"/>
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Position du param<61>tre</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Requis</entry>
|
||||
<entry>Defaut</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1</entry>
|
||||
<entry>entier</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>80</entry>
|
||||
<entry>La nombre de colonnes sur lequel ajuster l'affichage.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>2</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>\n</entry>
|
||||
<entry>cha<EFBFBD>ne de caract<63>res utilis<69>e pour l'ajustement.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>3</entry>
|
||||
<entry>bool<EFBFBD>en</entry>
|
||||
<entry>Non</entry>
|
||||
<entry>false</entry>
|
||||
<entry>D<EFBFBD>termine si l'ajustement se fait en fin de mot
|
||||
(false) ou au caract<63>re exact (true).</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Ajuste une cha<68>ne de caract<63>res <20> une taille de colonne, par d<>faut 80.
|
||||
Un second param<61>tre optionnel vous permet de sp<73>cifier la cha<68>ne <20> utiliser
|
||||
pour l'ajustement <20> la nouvelle ligne (retour chariot \n par d<>faut).
|
||||
Par d<>faut, wordwrap tente un ajustement <20> la fin d'un mot. Si vous voulez
|
||||
autoriser le d<>coupage des mots pour un ajustement au caract<63>re pr<70>s,
|
||||
passez true au troisi<73>me param<61>tre optionnel.
|
||||
</para>
|
||||
<example>
|
||||
<title>wordwrap</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('titreArticle', "Une femme aveugle obtient un nouveau rein
|
||||
d'un p<>re qu'elle n'a pas vu depuis des ann<6E>es.");
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
{$titreArticle}
|
||||
|
||||
{$titreArticle|wordwrap:30}
|
||||
|
||||
{$titreArticle|wordwrap:20}
|
||||
|
||||
{$titreArticle|wordwrap:30:"<br>\n"}
|
||||
|
||||
{$titreArticle|wordwrap:30:"\n":true}
|
||||
|
||||
SORTIE:
|
||||
|
||||
Une femme aveugle obtient un nouveau rein d'un p<>re qu'elle n'a pas vu depuis des ann<6E>es.
|
||||
|
||||
Une femme aveugle obtient un
|
||||
nouveau rein d'un p<>re
|
||||
qu'elle n'a pas vu depuis
|
||||
des ann<6E>es.
|
||||
|
||||
Une femme aveugle
|
||||
obtient un nouveau
|
||||
rein d'un p<>re
|
||||
qu'elle n'a pas vu
|
||||
depuis des ann<6E>es.
|
||||
|
||||
Une femme aveugle obtient un<br>
|
||||
nouveau rein d'un p<>re<br>
|
||||
qu'elle n'a pas vu depuis<br>
|
||||
des ann<6E>es.
|
||||
|
||||
Une femme aveugle obtient un n
|
||||
ouveau rein d'un p<>re qu'elle
|
||||
n'a pas vu depuis des ann<6E>es.
|
||||
</programlisting>
|
||||
</example>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<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.
|
||||
</para>
|
||||
<example>
|
||||
|
||||
<title>Variables assign<67>es</title>
|
||||
<programlisting>
|
||||
Bienvenue {$prenom}, heureux de voir que tu es arriv<69> ici.
|
||||
<p>
|
||||
La derni<6E>re connexion remonte au {$dateConnexionPrecedente}.
|
||||
|
||||
SORTIE:
|
||||
|
||||
Bienvenue Doug, heureux de voir que tu est arriv<69> ici.
|
||||
<p>
|
||||
La derni<6E>re connexion remonte au 11 janvier 2001.</programlisting>
|
||||
</example>
|
||||
|
||||
<sect2 id="language.variables.assoc.arrays">
|
||||
<title>Tableaux associatifs</title>
|
||||
<para>
|
||||
Vous pouvez <20>galement utiliser des variables sous forme de tableaux
|
||||
associatifs assign<67>es depuis PHP en en sp<73>cifiant la clef,
|
||||
apr<70>s le symbole '.' (point).
|
||||
</para>
|
||||
<example>
|
||||
<title>acc<EFBFBD>der aux variables de tableaux associatifs</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('Contacts',
|
||||
array('fax' => '555-222-9876',
|
||||
'email' => 'zaphod@slartibartfast.com',
|
||||
'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>
|
||||
zaphod@slartibartfast.com<br>
|
||||
555-444-3333<br>
|
||||
555-111-1234<br></programlisting>
|
||||
</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.
|
||||
</para>
|
||||
<example>
|
||||
<title>Acc<EFBFBD>s aux tableaux gr<67>ce <20> l'index</title>
|
||||
<programlisting>
|
||||
index.php:
|
||||
|
||||
$smarty = new Smarty;
|
||||
$smarty->assign('Contacts',
|
||||
array('555-222-9876',
|
||||
'zaphod@slartibartfast.com',
|
||||
array('555-444-3333',
|
||||
'555-111-1234')));
|
||||
$smarty->display('index.tpl');
|
||||
|
||||
index.tpl:
|
||||
|
||||
{$Contacts[0]}<br>
|
||||
{$Contacts[1]}<br>
|
||||
{* you can print arrays of arrays as well *}
|
||||
{$Contacts[2][0]}<br>
|
||||
{$Contacts[2][1]}<br>
|
||||
|
||||
SORTIE:
|
||||
|
||||
555-222-9876<br>
|
||||
zaphod@slartibartfast.com<br>
|
||||
555-444-3333<br>
|
||||
555-111-1234<br></programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="language.variables.objects">
|
||||
<title>Objets</title>
|
||||
<para>
|
||||
Les attributs des objets assign<67>s depuis PHP peuvent <20>tre utilis<69>es en
|
||||
en sp<73>cifiant le nom apr<70>s le symbole '->'.
|
||||
</para>
|
||||
<example>
|
||||
<title>acc<EFBFBD>der aux attributs des objets</title>
|
||||
<programlisting>
|
||||
nom: {$person->name}<br>
|
||||
email: {$person->email}<br>
|
||||
|
||||
SORTIE:
|
||||
|
||||
nom: Zaphod Beeblebrox<br>
|
||||
email: zaphod@slartibartfast.com<br></programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.config.variables">
|
||||
<title>Variables charg<72>es depuis des fichiers de configuration</title>
|
||||
<para>
|
||||
Les variables r<>cup<75>r<EFBFBD>es depuis un fichier de configuration sont utilis<69>es
|
||||
entour<75>es du symbole di<64>se (#), ou via la variable sp<73>ciale smarty
|
||||
<link
|
||||
linkend="language.variables.smarty.config">$smarty.config</link>.
|
||||
</para>
|
||||
<example>
|
||||
|
||||
<title>variables de fichiers de configuration</title>
|
||||
<programlisting>
|
||||
foo.conf:
|
||||
|
||||
pageTitle = "C'est le mien"
|
||||
bodyBgColor = "#eeeeee"
|
||||
tableBorderSize = "3"
|
||||
tableBgColor = "#bbbbbb"
|
||||
rowBgColor = "#cccccc"
|
||||
|
||||
index.tpl:
|
||||
|
||||
{config_load file="foo.conf"}
|
||||
<html>
|
||||
<title>{#pageTitle#}</title>
|
||||
<body bgcolor="{#bodyBgColor#}">
|
||||
<table border="{#tableBorderSize#}" bgcolor="{#tableBgColor#}">
|
||||
<tr bgcolor="{#rowBgColor#}">
|
||||
<td>First</td>
|
||||
<td>Last</td>
|
||||
<td>Address</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
index.tpl: (alternate syntax)
|
||||
|
||||
{config_load file="foo.conf"}
|
||||
<html>
|
||||
<title>{$smarty.config.pageTitle}</title>
|
||||
<body bgcolor="{$smarty.config.bodyBgColor}">
|
||||
<table border="{$smarty.config.tableBorderSize}" bgcolor="{$smarty.config.tableBgColor}">
|
||||
<tr bgcolor="{$smarty.config.rowBgColor}">
|
||||
<td>First</td>
|
||||
<td>Last</td>
|
||||
<td>Address</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
SORTIE: (same for both examples)
|
||||
|
||||
<html>
|
||||
<title>C'est le mien</title>
|
||||
<body bgcolor="#eeeeee">
|
||||
<table border="3" bgcolor="#bbbbbb">
|
||||
<tr bgcolor="#cccccc">
|
||||
<td>First</td>
|
||||
<td>Last</td>
|
||||
<td>Address</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html></programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Les variables de fichier de configuration ne peuvent <20>tre utilis<69>s tant
|
||||
qu'elles n'ont pas <20>t<EFBFBD> charg<72>es. Cette proc<6F>dure est expliqu<71>e
|
||||
plus loin dans le document, voir <command>config_load</command>.
|
||||
</para>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
@@ -0,0 +1,130 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.variables.smarty">
|
||||
<title>Variable r<>serv<72>e {$smarty}</title>
|
||||
<para>
|
||||
La variable r<>serv<72>e {$smarty} peut <20>tre utilis<69>e pour acc<63>der <20> plusieurs
|
||||
variables sp<73>ciales du template. En voici la liste compl<70>te.
|
||||
</para>
|
||||
|
||||
<sect2 id="language.variables.smarty.request">
|
||||
<title>Variables de requ<71>te</title>
|
||||
<para>
|
||||
Les variables de requ<71>te comme GET, POST, COOKIES, SERVER, ENVIRONNEMENT
|
||||
et SESSION peuvent <20>tre utilis<69>es comme dans l'exemple suivant:
|
||||
</para>
|
||||
<example>
|
||||
|
||||
<title>Afficher des variables de requ<71>te</title>
|
||||
<programlisting>
|
||||
{* Affiche la valeur de page dans l'url (GET) http://www.domain.com/index.php?page=foo *}
|
||||
{$smarty.get.page}
|
||||
|
||||
{* affiche la variable "page" r<>cup<75>r<EFBFBD>e depuis un formulaire (POST) *}
|
||||
{$smarty.post.page}
|
||||
|
||||
{* affiche la valeur du cookie "utilisateur" *}
|
||||
{$smarty.cookies.utilisateur}
|
||||
|
||||
{* affiche la variable serveur "SERVER_NAME" *}
|
||||
{$smarty.server.SERVER_NAME}
|
||||
|
||||
{* affiche la variable d'environnement "PATH" *}
|
||||
{$smarty.env.PATH}
|
||||
|
||||
{* affiche la variable de session PHP "id" *}
|
||||
{$smarty.session.id}
|
||||
|
||||
{* affiche la variable "utilisateur" du regroupement de get/post/cookies/server/env *}
|
||||
{$smarty.request.utilisateur}</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="language.variables.smarty.now">
|
||||
<title>{$smarty.now}</title>
|
||||
<para>
|
||||
Le timestamp courant peut <20>tre r<>cup<75>r<EFBFBD> gr<67>ce <20> {$smarty.now}.
|
||||
Le nombre obtenu correspond au nombre de secondes <20>coul<75>es depuis
|
||||
Epoch (1 Janvier 1970) et peut <20>tre pass<73> directement au modificateur
|
||||
de variable date <20> des fins d'affichage.
|
||||
</para>
|
||||
<example>
|
||||
|
||||
<title>utilisation de {$smarty.now}</title>
|
||||
<programlisting>
|
||||
{* utilise le modificateur de variable date_format pour afficher la date et heure *}
|
||||
{$smarty.now|date_format:"%d-%m-%Y %H:%M:%S"}</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
<sect2 id="language.variables.smarty.const">
|
||||
<title>{$smarty.const}</title>
|
||||
<para>
|
||||
Vous pouvez directement acc<63>der aux constantes PHP.
|
||||
</para>
|
||||
<example>
|
||||
|
||||
<title>Utiliser {$smarty.const}</title>
|
||||
<programlisting>
|
||||
{$smarty.const._MA_CONSTANTE_}</programlisting>
|
||||
</example>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="language.variables.smarty.capture">
|
||||
<title>{$smarty.capture}</title>
|
||||
<para>
|
||||
La capture r<>alis<69>e via {capture}..{/capture} peut <20>tre r<>cup<75>r<EFBFBD>e
|
||||
par l'interm<72>diaire de la variable {$smarty}. Voir la section
|
||||
sur <link linkend="language.function.capture">capture</link> pour un
|
||||
exemple <20> ce sujet.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="language.variables.smarty.config">
|
||||
<title>{$smarty.config}</title>
|
||||
<para>
|
||||
La variable {$smarty} peut <20>tre utilis<69>e pour d<>signer une variable
|
||||
d'un fichier de configuration. {$smarty.config.foo} est un synonyme de
|
||||
{#foo#}. Voir la section <link
|
||||
linkend="language.function.config.load">config_load</link>
|
||||
pour un exemple <20> ce sujet.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="language.variables.smarty.loops">
|
||||
<title>{$smarty.section}, {$smarty.foreach}</title>
|
||||
<para>
|
||||
La variable {$smarty} peut <20>tre utilis<69>e pour acc<63>der aux propri<72>t<EFBFBD>s
|
||||
des boucles 'section' et 'foreach'. Voir la documentation de
|
||||
<link linkend="language.function.section">section</link> et
|
||||
<link linkend="language.function.foreach">foreach</link>.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="language.variables.smarty.template">
|
||||
<title>{$smarty.template}</title>
|
||||
<para>
|
||||
Cette variable contient le nom du template en cours de traitement.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
Reference in New Issue
Block a user