mirror of
https://github.com/smarty-php/smarty.git
synced 2025-10-11 03:25:20 +02:00
Clean up WS, more linking and examples
This commit is contained in:
@@ -1,13 +1,58 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="variable.config.overwrite">
|
||||
<title>$config_overwrite</title>
|
||||
<para>
|
||||
If set to true, variables read in from config files will overwrite each
|
||||
other. Otherwise, the variables will be pushed onto an array. This is
|
||||
helpful if you want to store arrays of data in config files, just list
|
||||
each element multiple times. true by default.
|
||||
<sect1 id="variable.config.overwrite">
|
||||
<title>$config_overwrite</title>
|
||||
<para>
|
||||
If set to true (by default), variables read in from
|
||||
<link linkend="config.files">config files</link> will overwrite each
|
||||
other. Otherwise, the variables will be pushed onto an array. This is
|
||||
helpful if you want to store arrays of data in config files, just list
|
||||
each element multiple times.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Array of config variables</title>
|
||||
<para>
|
||||
This examples uses
|
||||
<link linkend="language.function.cycle">{cycle}</link> to
|
||||
ouput a table with alternating red/gree/blue row colors
|
||||
with $config_overwrite = false.
|
||||
</para>
|
||||
<para>The config file.</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
# row colors
|
||||
rowColors = #FF0000
|
||||
rowColors = #00FF00
|
||||
rowColors = #0000FF
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
The template with a
|
||||
<link linkend="language.function.section">{section}</link> loop.
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
<table>
|
||||
{section name=r loop=$rows}
|
||||
<tr bgcolor="{cycle values=#rowColors#}">
|
||||
<td> ....etc.... </td>
|
||||
</tr>
|
||||
{/section}
|
||||
</table>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
See also
|
||||
<link linkend="language.function.config.load">{config_load}</link>,
|
||||
<link linkend="config.files">config files</link>,
|
||||
<link linkend="api.get.config.vars">get_config_vars()</link>,
|
||||
<link linkend="api.clear.config">clear_config()</link>
|
||||
and
|
||||
<link linkend="api.config.load">config_load()</link>.
|
||||
</para>
|
||||
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
Reference in New Issue
Block a user