2004-04-13 15:43:47 +00:00
|
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
|
|
|
|
<!-- $Revision$ -->
|
2004-12-22 19:59:35 +00:00
|
|
|
|
<!-- EN-Revision: 1.4 Maintainer: gerald Status: ready -->
|
2004-05-23 15:50:53 +00:00
|
|
|
|
<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>
|
2004-07-04 10:02:31 +00:00
|
|
|
|
<![CDATA[
|
2004-12-22 19:59:35 +00:00
|
|
|
|
{* Affiche la valeur de page dans l'url (GET) http://www.example.com/index.php?page=foo *}
|
2004-04-13 15:43:47 +00:00
|
|
|
|
{$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 *}
|
2004-07-04 10:02:31 +00:00
|
|
|
|
{$smarty.request.utilisateur}
|
|
|
|
|
|
]]>
|
|
|
|
|
|
</programlisting>
|
2004-05-23 15:50:53 +00:00
|
|
|
|
</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>
|
2004-04-13 15:43:47 +00:00
|
|
|
|
<programlisting>
|
2004-07-04 10:02:31 +00:00
|
|
|
|
<![CDATA[
|
2004-04-13 15:43:47 +00:00
|
|
|
|
{* utilise le modificateur de variable date_format pour afficher la date et heure *}
|
2004-07-04 10:02:31 +00:00
|
|
|
|
{$smarty.now|date_format:"%d-%m-%Y %H:%M:%S"}
|
|
|
|
|
|
]]>
|
|
|
|
|
|
</programlisting>
|
2004-05-23 15:50:53 +00:00
|
|
|
|
</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>
|
2004-04-13 15:43:47 +00:00
|
|
|
|
<programlisting>
|
2004-07-04 10:02:31 +00:00
|
|
|
|
<![CDATA[
|
|
|
|
|
|
{$smarty.const._MA_CONSTANTE_}
|
|
|
|
|
|
]]>
|
|
|
|
|
|
</programlisting>
|
2004-05-23 15:50:53 +00:00
|
|
|
|
</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
|
2004-10-28 14:58:37 +00:00
|
|
|
|
<link linkend="language.function.foreach">foreach</link>.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</sect2>
|
2004-05-23 15:50:53 +00:00
|
|
|
|
|
2004-10-28 14:58:37 +00:00
|
|
|
|
<sect2 id="language.variables.smarty.template">
|
|
|
|
|
|
<title>{$smarty.template}</title>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
Cette variable contient le nom du template en cours de traitement.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
<sect2 id="language.variables.smarty.ldelim">
|
|
|
|
|
|
<title>{$smarty.ldelim}</title>
|
|
|
|
|
|
<para>
|
2004-12-22 19:59:35 +00:00
|
|
|
|
Cette variable est utilis<69>e pour afficher le d<>l<EFBFBD>miteur gauche. Lisez aussi
|
2004-11-08 02:10:34 +00:00
|
|
|
|
la partie <link
|
2004-10-28 14:58:37 +00:00
|
|
|
|
linkend="language.function.ldelim">{ldelim},{rdelim}</link>.
|
|
|
|
|
|
</para>
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
<sect2 id="language.variables.smarty.rdelim">
|
|
|
|
|
|
<title>{$smarty.rdelim}</title>
|
|
|
|
|
|
<para>
|
2004-12-22 19:59:35 +00:00
|
|
|
|
Cette variable est utilis<69>e pour afficher le d<>l<EFBFBD>miteur droit. Lisez aussi
|
2004-11-08 02:10:34 +00:00
|
|
|
|
la partie <link linkend="language.function.ldelim">{ldelim},{rdelim}</link>.
|
2004-10-28 14:58:37 +00:00
|
|
|
|
</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
|
|
|
|
|
|
-->
|