欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

smarty內(nèi)置函數(shù)config_load用法實例

 更新時間:2015年01月22日 11:54:05   投稿:shichen2014  
這篇文章主要介紹了smarty內(nèi)置函數(shù)config_load用法,實例分析了{(lán)config_load}配置變量的使用技巧,需要的朋友可以參考下

本文實例講述了smarty內(nèi)置函數(shù)config_load用法。分享給大家供大家參考。具體如下:

{config_load}用于從配置文件中,加載到配置變量。詳細(xì)用法如下:
配置文件:foo.conf

說明:[Table] 和 [Customer] 表示段落名稱。

復(fù)制代碼 代碼如下:
[Table]
pageTitle = "this is mine"
bodyBgColor = "#eee"
tableBorderSize = 3
tableBgColor = "#bbb"
rowBgColor = "#ccc"

[Customer]
pageTitle = "Customer Info"

模板文件:temp.htm

復(fù)制代碼 代碼如下:
{config_load file="foo.conf"}
{#pageTitle#}
{#bodyBgColor#}

第一種引入方法:錯誤。如果配置文件中每個段落都有名稱,則必須加上 section="段落名稱",才能加載到變量。
復(fù)制代碼 代碼如下:
{config_load file="foo.conf" section="Customer"}
{#pageTitle#}
{config_load file="foo.conf" section="Table"}
{#pageTitle#}

第二種加載方法,正確。加載相應(yīng)的段落,引入相應(yīng)的變量。

希望本文所述對大家的php程序設(shè)計有所幫助。

相關(guān)文章

最新評論