mirror of
				https://github.com/smarty-php/smarty.git
				synced 2025-11-04 06:11:37 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			77 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
			
		
		
	
	
			77 lines
		
	
	
		
			2.0 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
<?xml version="1.0" encoding="iso-8859-1"?>
 | 
						|
<!-- $Revision$ -->
 | 
						|
  <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
 | 
						|
      output a table with alternating red/green/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:
 | 
						|
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
 | 
						|
-->
 |