mirror of
https://github.com/smarty-php/smarty.git
synced 2025-10-06 17:20:54 +02:00
83 lines
2.5 KiB
XML
83 lines
2.5 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision$ -->
|
|
<refentry id="api.config.load">
|
|
<refnamediv>
|
|
<refname>config_load()</refname>
|
|
<refpurpose> loads config file data and assigns it to the template</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>void</type><methodname>config_load</methodname>
|
|
<methodparam><type>string</type><parameter>file</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>section</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
This loads
|
|
<link linkend="config.files">config file</link>
|
|
data and assigns it to
|
|
the template. This works identically to the template
|
|
<link linkend="language.function.config.load">
|
|
<varname>{config_load}</varname></link> function.
|
|
</para>
|
|
<note>
|
|
<title>Technical Note</title>
|
|
<para>
|
|
As of Smarty 2.4.0, assigned template variables are kept across
|
|
invocations of
|
|
<link linkend="api.fetch"><varname>fetch()</varname></link>
|
|
and <link linkend="api.display"><varname>display()</varname></link>.
|
|
Config vars loaded from
|
|
<varname>config_load()</varname> are always global in scope.
|
|
Config files are also compiled for faster execution, and respect the
|
|
<link linkend="variable.force.compile">
|
|
<parameter>$force_compile</parameter></link> and
|
|
<link linkend="variable.compile.check">
|
|
<parameter>$compile_check</parameter></link> settings.
|
|
</para>
|
|
</note>
|
|
<example>
|
|
<title>config_load()</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// load config variables and assign them
|
|
$smarty->config_load('my.conf');
|
|
|
|
// load a section
|
|
$smarty->config_load('my.conf', 'foobar');
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
<para>
|
|
See also
|
|
<link linkend="language.function.config.load"><varname>{config_load}</varname></link>,
|
|
<link linkend="api.get.config.vars"><varname>get_config_vars()</varname></link>,
|
|
<link linkend="api.clear.config"><varname>clear_config()</varname></link>,
|
|
and
|
|
<link linkend="language.config.variables"><varname>config variables</varname></link>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
<!-- 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
|
|
-->
|