What is Smarty?
Why use it?
Use Cases and Work Flow
Syntax Comparison
Template Inheritance
Best Practices
Crash Course
You may use the Smarty logo according to the trademark notice.
For sponsorship, advertising, news or other inquiries, contact us at:
addConfigDir() — 增加一个配置文件目录
Smarty addConfigDir(string|array config_dir,
string key);
Example 14.1. addConfigDir()
<?php // 增加一个配置文件的目录 $smarty->addConigDir('./config_1'); // 增加一个配置文件的目录并指定一个数组键值 $smarty->addConfigDir('./config_1', 'one'); // 以数组的方式加入多个配置文件目录,并为每个目录设定一个键值。 $smarty->addConfigDir(array( 'two' => './config_2', 'three' => './config_3', )); // 显示全部的配置目录 var_dump($smarty->getConfigDir()); // 方法连用 $smarty->setConfigDir('./config') ->addConfigDir('./config_1', 'one') ->addConfigDir('./config_2', 'two'); ?>