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!

Advertisement

Name

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');

?>

   

参见 getConfigDir(), setConfigDir()$config_dir.

Comments
No comments for this page.

Advertisement