$config_overwrite

$config_overwrite

If set to true (by default), 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.

Example 12-3. Array of config variables

This examples uses {cycle} to output a table with alternating red/green/blue row colors with $config_overwrite = false.

The config file.

# row colors
rowColors = #FF0000
rowColors = #00FF00
rowColors = #0000FF

The template with a {section} loop.

<table>
  {section name=r loop=$rows}
  <tr bgcolor="{cycle values=#rowColors#}">
    <td> ....etc.... </td>
  </tr>
  {/section}
</table>

See also {config_load}, config files, get_config_vars(), clear_config() and config_load().

© Copyright 2003-2014 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.