aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/smarty/smarty/docs/programmers/api-functions/api-set-config-dir.md
blob: 97a6ae9776a567a9b57e649597f7abb6116eef97 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
setConfigDir()

set the directories where config files are stored

Description
===========

Smarty

setConfigDir

string\|array

config\_dir


    <?php

    // set a single directory where the config files are stored
    $smarty->setConfigDir('./config');

    // view the config dir chain
    var_dump($smarty->getConfigDir());

    // set multiple directoríes where config files are stored
    $smarty->setConfigDir(array(
        'one' => './config',
        'two' => './config_2',
        'three' => './config_3',
    ));

    // view the config dir chain
    var_dump($smarty->getConfigDir());

    // chaining of method calls
    $smarty->setTemplateDir('./templates')
           ->setConfigDir('./config')
           ->setCompileDir('./templates_c')
           ->setCacheDir('./cache');

    ?>

       

See also [`getConfigDir()`](#api.get.config.dir),
[`addConfigDir()`](#api.add.config.dir) and
[`$config_dir`](#variable.config.dir).