What is Smarty?
Why use it?
Use Cases and Work Flow
Syntax Comparison
Template Inheritance
Best Practices
Crash Course
You may use the Smarty logo according to the trademark notice.
For sponsorship, advertising, news or other inquiries, contact us at:
TRUE の場合、
設定ファイル
から読み込んだ変数は互いに上書きされます (デフォルトは TRUE)。
FALSE の場合、変数は配列にプッシュされます。
これは各要素を複数回リストするような、
設定ファイルのデータの配列を格納したい場合に役立ちます。
Example 12.2. 設定ファイル変数の配列
この例では $config_overwrite = FALSE とし、
{cycle}
でテーブルの行の色を 赤/緑/青 と切り替えています。
設定ファイル
# row colors
rowColors = #FF0000
rowColors = #00FF00
rowColors = #0000FF
{section} ループを使用したテンプレート
<table>
{section name=r loop=$rows}
<tr bgcolor="{cycle values=#rowColors#}">
<td> ....何かの内容.... </td>
</tr>
{/section}
</table>
{config_load}、
get_config_vars()、
clear_config()、
config_load()
および config files section
も参照してください。