config_load関數(shù)
config_load 関數(shù)
使用法:
設(shè)定ファイルには複數(shù)の部分が含まれる場(chǎng)合があります。追加の屬性セクションを使用して、どの部分から変數(shù)を取得するかを指定できます。同じものであり、互いに何の関係もありません。
#例:
test.html:
{config_load file="colors.conf" section="Customer"} <html> <title>{#pageTitle#}</title> <body bgcolor="{#bodyBgColor#}"> <table border="{#tableBorderSize#}" bgcolor="{#tableBgColor#}"> <tr bgcolor="{#rowBgColor#}"> <td>First</td> <td>Last</td> <td>Address</td> </tr> </table> </body> </html>
colors.conf:
#注釋 #段落變量 [Customer] pageTitle='顧客表' bodyBgColor='#00f' tableBorderSize='1' tableBgColor='skyblue' rowBgColor='red' tableBgColor='skyblue' [Person] pageTitle='所有人表' bodyBgColor='#eee' tableBorderSize='1' tableBgColor='skyblue' rowBgColor='red' tableBgColor='skyblue' [other] other='這是其他'
実行結(jié)果: