mirror of
https://github.com/smarty-php/smarty.git
synced 2025-10-28 10:51:37 +01:00
86 lines
2.5 KiB
XML
86 lines
2.5 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 1.4 Maintainer: andreas Status: ready -->
|
|
<sect1 id="variable.config.overwrite">
|
|
<title>$config_overwrite</title>
|
|
<para>
|
|
<!-- 'Variable' sollte eigentlich besser 'Wert' heissen -->
|
|
Definiert ob gleichnamige Variablen, die aus
|
|
<link linkend="config.files">Konfigurationsdateien</link>
|
|
gelesen werden, sich gegenseitig überschreiben.
|
|
Der Standardwert für $config_overwrite ist true.
|
|
</para>
|
|
|
|
<para>
|
|
Wenn $config_overwrite auf false gesetzt wird,
|
|
dann wird aus gleichnamigen Variablen ein Array erstellt.
|
|
Um folglich ein Array in Konfigurationsdateien ablegen zu können
|
|
brauchen Sie das entsprechende Element einfach nur mehrfach aufzuführen.
|
|
</para>
|
|
|
|
<example>
|
|
<title>Array von Konfigurationswerten</title>
|
|
<para>
|
|
Dieses Beispiel verwendet
|
|
<link linkend="language.function.cycle">{cycle}</link>
|
|
um eine Tabelle abwechselnd mit roten, grünen und blauen
|
|
Zeilen auszugeben.
|
|
$config_overwrite ist auf false gesetzt um aus den
|
|
Farbangaben ein Array zu erzeugen.
|
|
</para>
|
|
<para>Die Konfigurationsdatei.</para>
|
|
<programlisting>
|
|
<![CDATA[
|
|
# row colors
|
|
rowColors = #FF0000
|
|
rowColors = #00FF00
|
|
rowColors = #0000FF
|
|
]]>
|
|
</programlisting>
|
|
<para>
|
|
Das Template mit einer
|
|
<link linkend="language.function.section">{section}</link> Schleife.
|
|
</para>
|
|
<programlisting>
|
|
<![CDATA[
|
|
<table>
|
|
{section name=r loop=$rows}
|
|
<tr bgcolor="{cycle values=#rowColors#}">
|
|
<td> ....etc.... </td>
|
|
</tr>
|
|
{/section}
|
|
</table>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
<para>
|
|
Siehe auch
|
|
<link linkend="config.files">Konfigurationsdateien</link>,
|
|
<link linkend="api.get.config.vars">get_config_vars()</link>,
|
|
<link linkend="api.clear.config">clear_config()</link>
|
|
<link linkend="api.config.load">config_load()</link>
|
|
und
|
|
<link linkend="language.function.config.load">{config_load}</link>.
|
|
</para>
|
|
</sect1>
|
|
<!-- 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
|
|
-->
|