2004-04-13 15:43:47 +00:00
|
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
|
|
|
|
<!-- $Revision$ -->
|
2006-10-03 20:48:58 +00:00
|
|
|
|
<!-- EN-Revision: 1.6 Maintainer: yannick Status: ready -->
|
2005-12-10 22:09:38 +00:00
|
|
|
|
|
2004-05-23 15:50:53 +00:00
|
|
|
|
<sect1 id="language.config.variables">
|
|
|
|
|
|
<title>Variables charg<72>es depuis des fichiers de configuration</title>
|
|
|
|
|
|
<para>
|
2006-10-03 20:48:58 +00:00
|
|
|
|
Les variables r<>cup<75>r<EFBFBD>es depuis un
|
|
|
|
|
|
<link linkend="config.files">fichier de configuration</link> sont utilis<69>es
|
2004-05-23 15:50:53 +00:00
|
|
|
|
entour<75>es du symbole di<64>se (#), ou via la variable sp<73>ciale smarty
|
2006-10-03 20:48:58 +00:00
|
|
|
|
<link linkend="language.variables.smarty.config"><parameter>$smarty.config</parameter></link>.
|
|
|
|
|
|
La derni<6E>re synthaxe est utile pour mettre entre guillemets les valeurs des attributs.
|
2005-05-24 22:13:50 +00:00
|
|
|
|
</para>
|
|
|
|
|
|
<example>
|
|
|
|
|
|
<title>variables de fichiers de configuration</title>
|
|
|
|
|
|
<para>
|
2006-10-03 20:48:58 +00:00
|
|
|
|
Exemple de fichier de configuration - <filename>foo.conf</filename> :
|
2004-05-23 15:50:53 +00:00
|
|
|
|
</para>
|
2005-05-24 22:13:50 +00:00
|
|
|
|
<programlisting>
|
2004-07-04 10:02:31 +00:00
|
|
|
|
<![CDATA[
|
2004-04-13 15:43:47 +00:00
|
|
|
|
pageTitle = "C'est le mien"
|
2006-10-03 20:48:58 +00:00
|
|
|
|
bodyBgColor = '#eeeeee'
|
|
|
|
|
|
tableBorderSize = 3
|
|
|
|
|
|
tableBgColor = '#bbbbbb'
|
|
|
|
|
|
rowBgColor = '#cccccc'
|
2004-07-04 10:02:31 +00:00
|
|
|
|
]]>
|
2005-05-24 22:13:50 +00:00
|
|
|
|
</programlisting>
|
|
|
|
|
|
<para>
|
2006-10-03 20:48:58 +00:00
|
|
|
|
Exemple de template :
|
2005-05-24 22:13:50 +00:00
|
|
|
|
</para>
|
|
|
|
|
|
<programlisting>
|
2004-07-04 10:02:31 +00:00
|
|
|
|
<![CDATA[
|
2006-10-03 20:48:58 +00:00
|
|
|
|
{config_load file='foo.conf'}
|
2004-07-04 10:02:31 +00:00
|
|
|
|
<html>
|
|
|
|
|
|
<title>{#pageTitle#}</title>
|
|
|
|
|
|
<body bgcolor="{#bodyBgColor#}">
|
|
|
|
|
|
<table border="{#tableBorderSize#}" bgcolor="{#tableBgColor#}">
|
|
|
|
|
|
<tr bgcolor="{#rowBgColor#}">
|
2005-05-24 22:13:50 +00:00
|
|
|
|
<td>First</td>
|
|
|
|
|
|
<td>Last</td>
|
|
|
|
|
|
<td>Address</td>
|
2004-07-04 10:02:31 +00:00
|
|
|
|
</tr>
|
|
|
|
|
|
</table>
|
|
|
|
|
|
</body>
|
|
|
|
|
|
</html>
|
|
|
|
|
|
]]>
|
2005-05-24 22:13:50 +00:00
|
|
|
|
</programlisting>
|
|
|
|
|
|
<para>
|
2006-10-03 20:48:58 +00:00
|
|
|
|
Un template d<>montrant la m<>thode
|
|
|
|
|
|
<link linkend="language.variables.smarty.config">
|
|
|
|
|
|
<parameter>$smarty.config</parameter></link> :
|
2005-05-24 22:13:50 +00:00
|
|
|
|
</para>
|
|
|
|
|
|
<programlisting>
|
2004-07-04 10:02:31 +00:00
|
|
|
|
<![CDATA[
|
2004-04-13 15:43:47 +00:00
|
|
|
|
{config_load file="foo.conf"}
|
2004-07-04 10:02:31 +00:00
|
|
|
|
<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}">
|
2005-05-24 22:13:50 +00:00
|
|
|
|
<td>First</td>
|
|
|
|
|
|
<td>Last</td>
|
|
|
|
|
|
<td>Address</td>
|
2004-07-04 10:02:31 +00:00
|
|
|
|
</tr>
|
|
|
|
|
|
</table>
|
|
|
|
|
|
</body>
|
|
|
|
|
|
</html>
|
|
|
|
|
|
]]>
|
2005-05-24 22:13:50 +00:00
|
|
|
|
</programlisting>
|
|
|
|
|
|
<para>
|
2006-10-03 20:48:58 +00:00
|
|
|
|
Les deux exemples ci-dessus afficheront :
|
2005-05-24 22:13:50 +00:00
|
|
|
|
</para>
|
|
|
|
|
|
<screen>
|
2004-07-04 10:02:31 +00:00
|
|
|
|
<![CDATA[
|
|
|
|
|
|
<html>
|
|
|
|
|
|
<title>C'est le mien</title>
|
|
|
|
|
|
<body bgcolor="#eeeeee">
|
|
|
|
|
|
<table border="3" bgcolor="#bbbbbb">
|
|
|
|
|
|
<tr bgcolor="#cccccc">
|
2005-05-24 22:13:50 +00:00
|
|
|
|
<td>First</td>
|
|
|
|
|
|
<td>Last</td>
|
|
|
|
|
|
<td>Address</td>
|
2004-07-04 10:02:31 +00:00
|
|
|
|
</tr>
|
|
|
|
|
|
</table>
|
|
|
|
|
|
</body>
|
|
|
|
|
|
</html>
|
|
|
|
|
|
]]>
|
2005-05-24 22:13:50 +00:00
|
|
|
|
</screen>
|
|
|
|
|
|
</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 <link
|
2006-10-03 20:48:58 +00:00
|
|
|
|
linkend="api.config.load"><varname>{config_load}</varname></link>.
|
2005-12-10 22:09:38 +00:00
|
|
|
|
</para>
|
|
|
|
|
|
<para>
|
|
|
|
|
|
Voir aussi
|
|
|
|
|
|
les <link linkend="language.syntax.variables">variables</link> et
|
|
|
|
|
|
les <link linkend="language.variables.smarty">variables r<>serv<72>es $smarty</link>.
|
|
|
|
|
|
</para>
|
2005-05-24 22:13:50 +00:00
|
|
|
|
</sect1>
|
|
|
|
|
|
|
2004-05-23 15:50:53 +00:00
|
|
|
|
<!-- 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
|
2005-05-24 22:13:50 +00:00
|
|
|
|
-->
|