Files
smarty/docs/fr/designers/language-builtin-functions/language-function-config-load.xml

148 lines
4.0 KiB
XML
Raw Normal View History

2004-04-13 15:43:47 +00:00
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
2004-05-23 13:49:44 +00:00
<!-- EN-Revision: 1.1 Maintainer: nobody Status: partial -->
2004-05-23 15:44:59 +00:00
<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>
2004-05-23 13:49:44 +00:00
<![CDATA[
2004-04-13 15:43:47 +00:00
{config_load file="colors.conf"}
2004-05-23 13:49:44 +00:00
<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>
]]>
2004-05-23 15:44:59 +00:00
</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>
<note>
<para>
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>
</note>
<example>
<title>fonction config_load et section</title>
<programlisting>
2004-05-23 13:49:44 +00:00
<![CDATA[
2004-04-13 15:43:47 +00:00
{config_load file="colors.conf" section="client"}
2004-05-23 13:49:44 +00:00
<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>
]]>
2004-05-23 15:44:59 +00:00
</programlisting>
</example>
</sect1>
2004-04-13 15:43:47 +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
2004-05-23 13:49:44 +00:00
-->