mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
added <![CDATA[ tags, synx translation informations. Designers section is now up to date.
This commit is contained in:
@@ -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"}
|
||||
<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>
|
||||
|
||||
<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"}
|
||||
<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>
|
||||
<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
|
||||
|
@@ -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>
|
||||
|
||||
|
Reference in New Issue
Block a user