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.


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
// 加载配置变量

// load a section
// 加载其中一节