我的文件结构:
--header.php
--smarty
--templates
-- x.tpl
--cache
--configs
--templates_c
--articles
-- testPage.php
header.php 中的代码
$smarty = new Smarty();
$smarty->setTemplateDir('smarty/templates');
$smarty->setCompileDir('smarty/templates_c');
$smarty->setCacheDir('smarty/cache');
$smarty->setConfigDir('smarty/configs');
testPage.php 中的代码
<?php
include('../header.php');
$smarty->display('x.tpl');
?>
我遇到了这个错误:
PHP Fatal error: Uncaught exception 'SmartyException' with message 'Unable to
load template file 'x.tpl'' in
/usr/local/lib/php/Smarty/sysplugins/smarty_internal_templatebase.php:127
如何设置正确的路径来访问我的 testPage.php 中的 smarty 模板?