Skip to content

\$config_overwrite {#variable.config.overwrite}

如果设置为 TRUE,则从配置文件中读取的默认变量将互相覆盖。否则,变量将被推送到一个数组中。如果您想在配置文件中存储数据数组,这将非常有用,只需多次列出每个元素即可。

以下示例使用 {cycle} 来输出具有交替红/绿/蓝行颜色的表格,其中 $config_overwrite = FALSE。

配置文件:

    # 行颜色
    rowColors = #FF0000
    rowColors = #00FF00
    rowColors = #0000FF

模板中使用 {section} 循环:

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

另请参阅 {config_load}getConfigVars()clearConfig()configLoad()config files section