Get Smarty

Donate

Paypal

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

Advertisement

$template_dir

默认模板目录的设置。 如果在包含文件时没有设置资源类型,那么Smarty会查询本目录。 默认值是./templates,意味着Smaty会查询templates/寻找模板文件和执行PHP脚本。 $template_dir同样可以是一个多目录值的数组,Smarty将逐个查询这些目录直到匹配的模板被找到为止。

技术说明

不建议把该目录放到web根目录中。

技术说明

如果$template_dir 的目录是相对include_path的目录, 那么你需要打开$use_include_path 设置。

说明

在Smarty 3.1之后,$template_dir属性不能直接访问,需使用 getTemplateDir()setTemplateDir()addTemplateDir()来进行存取。

参见 资源, $use_include_path, getTemplateDir(), setTemplateDir()addTemplateDir().

Comments
No comments for this page.

Advertisement

Sponsors [info]

Sponsors