| 148 |
lars |
1 |
\$template\_dir {#variable.template.dir}
|
|
|
2 |
===============
|
|
|
3 |
|
|
|
4 |
This is the name of the default template directory. If you do not supply
|
|
|
5 |
a resource type when including files, they will be found here. By
|
|
|
6 |
default this is `./templates`, meaning that Smarty will look for the
|
|
|
7 |
`templates/` directory in the same directory as the executing php
|
|
|
8 |
script. \$template\_dir can also be an array of directory paths: Smarty
|
|
|
9 |
will traverse the directories and stop on the first matching template
|
|
|
10 |
found.
|
|
|
11 |
|
|
|
12 |
> **Note**
|
|
|
13 |
>
|
|
|
14 |
> It is not recommended to put this directory under the web server
|
|
|
15 |
> document root.
|
|
|
16 |
|
|
|
17 |
> **Note**
|
|
|
18 |
>
|
|
|
19 |
> If the directories known to `$template_dir` are relative to
|
|
|
20 |
> directories known to the
|
|
|
21 |
> [include\_path](&url.php-manual;ini.core.php#ini.include-path) you
|
|
|
22 |
> need to activate the [`$use_include_path`](#variable.use.include.path)
|
|
|
23 |
> option.
|
|
|
24 |
|
|
|
25 |
> **Note**
|
|
|
26 |
>
|
|
|
27 |
> As of Smarty 3.1 the attribute \$template\_dir is no longer accessible
|
|
|
28 |
> directly. Use [`getTemplateDir()`](#api.get.template.dir),
|
|
|
29 |
> [`setTemplateDir()`](#api.set.template.dir) and
|
|
|
30 |
> [`addTemplateDir()`](#api.add.template.dir) instead.
|
|
|
31 |
|
|
|
32 |
See also [`Template Resources`](#resources),
|
|
|
33 |
[`$use_include_path`](#variable.use.include.path),
|
|
|
34 |
[`getTemplateDir()`](#api.get.template.dir),
|
|
|
35 |
[`setTemplateDir()`](#api.set.template.dir) and
|
|
|
36 |
[`addTemplateDir()`](#api.add.template.dir).
|