\$compile_dir {/programmers/api-variables/variable-compile-dir/}
这是编译模板所在的目录的名称。默认情况下,它是 ./templates_c,意味着 Smarty 将在执行 PHP 脚本的同一目录中查找 templates_c/ 目录。此目录必须对 Web 服务器具有写权限,有关更多信息,请参阅安装。
注意
此设置必须是相对路径或绝对路径。include_path 不用于写入文件。
注意
不建议将此目录放在 Web 服务器文档根目录下。
注意
从 Smarty 3.1 开始,不再直接访问属性 \$compile_dir。请改用
getCompileDir()和setCompileDir()。
另请参阅 getCompileDir()、setCompileDir()、$compile_id 和 $use_sub_dirs。