Get Smarty

Donate

Paypal

Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Sites Using Smarty

Advertisement

$config_overwrite

Definiert ob gleichnamige Variablen, die aus Konfigurationsdateien gelesen werden, sich gegenseitig überschreiben. Der Standardwert für $config_overwrite ist true.

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.

Example 12.3. Array von Konfigurationswerten

Dieses Beispiel verwendet {cycle} 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.

Die Konfigurationsdatei.


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

    

Das Template mit einer {section} Schleife.


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

    

Siehe auch Konfigurationsdateien, get_config_vars(), clear_config() config_load() und {config_load}.

Comments
No comments for this page.

Advertisement

Sponsors [info]

Sponsors