Get Smarty

Donate

Donate Bitcoin Bitcoin
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

Buy cheap eyeglasses from Cheapglasses123.com and save up to 80%.

Buy prescription glasses from www.australiaglasses.com and save.

Cheap Glasses Now On Sale at GlassesPeople.com. Starts At $7.95.

Where to buy discount wedding dresses and cheap smart dresses free shipping - Weddingdresstrend.com

Brautkleider auf Topwedding.de

Find free files to download on allwhatyouwant.net

Looking For Affordable Wedding Dresses 2015 at Best Prices On TDBridal.com

Shop high quality cheap prom dresses on Dresswe.co.uk

Buy New Arrival Cheap Prom Dresses 2015 at JDBRIDAL Prom Dress Store

Advertisement

Chapter 9. �置文件

�置文件�以让设计者将全局的模���以文件形�管�起�。 其中一个例�是管�模�的颜色值: 通常如果你需�从程�中更改颜色主题,那么你需�找到�个模�文件, 并且修改它们的颜色值。 通过�置文件,颜色值被统一放置到�置文件内,你�需�修改这个文件��。

Example 9.1. �置文件语法示例


# global variables
pageTitle = "Main Menu"
bodyBgColor = #000000
tableBgColor = #000000
rowBgColor = #00ff00

[Customer]
pageTitle = "Customer Info"

[Login]
pageTitle = "Login"
focus = "username"
Intro = """This is a value that spans more
           than one line. you must enclose
           it in triple quotes."""

# hidden section
[.Database]
host=my.example.com
db=ADDRESSBOOK
user=php-user
pass=foobar

  

�置文件中的�置���以被引用起�,但�是必须的。 你�以使用�引�或者�引�。 如果有的值会跨度�止一行的,那么你需�用三引�(""")把它们括起�。 你�以将任何形�的注释放到�置文件中,但这�是有效的�置文件语法。 我们建议使用# (井�) �作为注释行的开头。

上��置文件的例�有两段。 段�的�字用[方括�]括起�。 段��称�以是任�字符,但�包括[ 或 ]符�。 最顶部的四个值是全局��,也就是�在段�内的��。 这些全局��将总是被载入。 当一个特定的段�被载入,那么段�的��以�全局��都会被载入。 如全局��和段���都有�样的��,那么将使用段�的��。 如有相�的两个��在�一个段�,最�一个将会被使用,除� $config_overwrite设置被关闭。

�置文件�以使用内置的函数 {config_load}�载入,或者通过configLoad()函数进行载入。

你�以通过在���或段����加上点�(.),�����或者整个段�,如[.hidden]。 这个技巧在你的程�使用�置文件�存一些�感信�,但这些信���希望模�引擎使用时,�常有用。 如果是第三方�对模�进行修改,你也�以��他们�会在载入�置文件时,读�到这些�感信�

�置文件(或资�)将使用相�的模�资��进行载入。 这�味��置文件还�以从数�库中载入,如$smarty->configLoad("db:my.conf")。

�� {config_load}, $config_overwrite, $default_config_handler_func, getConfigVars(), clearConfig() 和 configLoad()

Comments
No comments for this page.
Post a Comment
All comments are moderated. Support questions are ignored, use the forums instead.
Author:
Email: (not shown)
What is 2 plus 15? (Are you human?)

Advertisement