Get Smarty

Donate

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 glasses from Cheapglasses123.com and save up to 80%.

Where to buy prescription glasses? EyewearCanada.com is your best choice!

Visit www.sport-kick.com for cheap soccer cleats, sneakers and Soccer Jerseys updates

Advertisement

Name

configLoad() — 载入预配置的变量

说明

void configLoad(string file,
                string section);

该函数将从文件中载入预配置的变量,功能等同{config_load}函数。

技术说明

从Smarty 2.4.0开始,当程序调用fetch()display()的时候,预配置文件才会被载入并赋值,同时 configLoad()加载的变量总是全局的变量。 如果希望更快速地载入预配置变量,请开启 $force_compile $compile_check配置。

Example 14.16. configLoad()


<?php
// 载入文件中预配置的变量
$smarty->configLoad('my.conf');

// 载入部分变量
$smarty->configLoad('my.conf', 'foobar');
?>

   

参见 {config_load}, getConfigVars(), clearConfig(), 和 预配置变量

Comments
No comments for this page.

Advertisement