aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/smarty/smarty/docs/programmers/api-functions/api-get-template-dir.md
blob: 42c75908bbcb77212a85dca1ad85a3e70557fd45 (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
getTemplateDir()

return the directory where templates are stored

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

string\|array

getTemplateDir

string

key


    <?php

    // set some template directories
    $smarty->setTemplateDir(array(
        'one' => './templates',
        'two' => './templates_2',
        'three' => './templates_3',
    ));

    // get all directories where templates are stored
    $template_dir = $smarty->getTemplateDir();
    var_dump($template_dir); // array

    // get directory identified by key
    $template_dir = $smarty->getTemplateDir('one');
    var_dump($template_dir); // string

    ?>

       

See also [`setTemplateDir()`](#api.set.template.dir),
[`addTemplateDir()`](#api.add.template.dir) and
[`$template_dir`](#variable.template.dir).