config_load
加载配置

void config_load(string file [, string section])

This loads config file data and assigns it to the template. This works identical to the template config_load function.

加载配置文件,并将其中的数据传送到模板中,它的功能和config_load函数是一样的。

Technical Note: As of Smarty 2.4.0, assigned template variables are kept across invocations of fetch() and display(). Config vars loaded from config_load() are always global scope. Config files are also compiled for faster execution, and respect the force_compile and compile_check settings.

注意:到Smarty 2.4.0为止,已赋值的模板变量对于fetch()和display()方法是共享调用的,而使用config_load()加载的变量是全局的。并且 在编译时配置文件也将被编译,以加快执行速度,并且遵守force_compilecompile_check设置。

Example 13-11. config_load
例子 13-11. 加载配置

// load config variables and assign them
// 加载配置变量
$smarty->config_load('my.conf');

// load a section
// 加载其中一节
$smarty->config_load('my.conf','foobar');