added <![CDATA[ tags, synx translation informations. Designers section is now up to date.

This commit is contained in:
gerald
2004-07-04 10:02:31 +00:00
parent 70e05aaf37
commit ee46e61fc6
2 changed files with 75 additions and 51 deletions

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial -->
<!-- EN-Revision: 1.1 Maintainer: gerald Status: ready -->
<sect1 id="language.config.variables">
<title>Variables charg<72>es depuis des fichiers de configuration</title>
<para>
@@ -12,62 +12,77 @@
<example>
<title>variables de fichiers de configuration</title>
<para>
foo.conf
</para>
<programlisting>
foo.conf:
<![CDATA[
pageTitle = "C'est le mien"
bodyBgColor = "#eeeeee"
tableBorderSize = "3"
tableBgColor = "#bbbbbb"
rowBgColor = "#cccccc"
]]>
</programlisting>
<para>
index.tpl:
</para>
<programlisting>
<![CDATA[
{config_load file="foo.conf"}
&lt;html&gt;
&lt;title&gt;{#pageTitle#}&lt;/title&gt;
&lt;body bgcolor="{#bodyBgColor#}"&gt;
&lt;table border="{#tableBorderSize#}" bgcolor="{#tableBgColor#}"&gt;
&lt;tr bgcolor="{#rowBgColor#}"&gt;
&lt;td&gt;First&lt;/td&gt;
&lt;td&gt;Last&lt;/td&gt;
&lt;td&gt;Address&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;
<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>
<para>
index.tpl: (alternate syntax)
</para>
<programlisting>
<![CDATA[
{config_load file="foo.conf"}
&lt;html&gt;
&lt;title&gt;{$smarty.config.pageTitle}&lt;/title&gt;
&lt;body bgcolor="{$smarty.config.bodyBgColor}"&gt;
&lt;table border="{$smarty.config.tableBorderSize}" bgcolor="{$smarty.config.tableBgColor}"&gt;
&lt;tr bgcolor="{$smarty.config.rowBgColor}"&gt;
&lt;td&gt;First&lt;/td&gt;
&lt;td&gt;Last&lt;/td&gt;
&lt;td&gt;Address&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;
SORTIE: (same for both examples)
&lt;html&gt;
&lt;title&gt;C'est le mien&lt;/title&gt;
&lt;body bgcolor="#eeeeee"&gt;
&lt;table border="3" bgcolor="#bbbbbb"&gt;
&lt;tr bgcolor="#cccccc"&gt;
&lt;td&gt;First&lt;/td&gt;
&lt;td&gt;Last&lt;/td&gt;
&lt;td&gt;Address&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;</programlisting>
<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>
]]>
</programlisting>
<para>
Ce qui donne en sortie, pour les deux exemples :
</para>
<screen>
<![CDATA[
<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>
]]>
</screen>
</example>
<para>
Les variables de fichier de configuration ne peuvent <20>tre utilis<69>s tant

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial -->
<!-- EN-Revision: 1.1 Maintainer: gerald Status: ready -->
<sect1 id="language.variables.smarty">
<title>Variable r<>serv<72>e {$smarty}</title>
<para>
@@ -18,6 +18,7 @@
<title>Afficher des variables de requ<71>te</title>
<programlisting>
<![CDATA[
{* Affiche la valeur de page dans l'url (GET) http://www.domain.com/index.php?page=foo *}
{$smarty.get.page}
@@ -37,7 +38,9 @@
{$smarty.session.id}
{* affiche la variable "utilisateur" du regroupement de get/post/cookies/server/env *}
{$smarty.request.utilisateur}</programlisting>
{$smarty.request.utilisateur}
]]>
</programlisting>
</example>
</sect2>
@@ -53,8 +56,11 @@
<title>utilisation de {$smarty.now}</title>
<programlisting>
<![CDATA[
{* utilise le modificateur de variable date_format pour afficher la date et heure *}
{$smarty.now|date_format:"%d-%m-%Y %H:%M:%S"}</programlisting>
{$smarty.now|date_format:"%d-%m-%Y %H:%M:%S"}
]]>
</programlisting>
</example>
</sect2>
<sect2 id="language.variables.smarty.const">
@@ -66,7 +72,10 @@
<title>Utiliser {$smarty.const}</title>
<programlisting>
{$smarty.const._MA_CONSTANTE_}</programlisting>
<![CDATA[
{$smarty.const._MA_CONSTANTE_}
]]>
</programlisting>
</example>
</sect2>