怎么用smarty输出配置文件中的变量

2024-12-26 04:02:19
推荐回答(1个)
回答1:

foo.conf:

pageTitle = "This is mine"
bodyBgColor = "#eeeeee"
tableBorderSize = "3"
tableBgColor = "#bbbbbb"
rowBgColor = "#cccccc"

index.tpl:

{config_load file="foo.conf"}

{#pageTitle#}







First Last Address




index.tpl: (alternate syntax)

{config_load file="foo.conf"}

{$smarty.config.pageTitle}







First Last Address




OUTPUT: (same for both examples)


This is mine







First Last Address