내 파일 구조 :액세스 스마티 템플릿
: header.php에서--header.php
--smarty
--templates
-- x.tpl
--cache
--configs
--templates_c
--articles
-- testPage.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에서 멋진 템플릿에 액세스하는 올바른 경로를 설정하는 방법은 무엇입니까?
절대 경로를 제공하려고 시도 했습니까? – shawndreck
혹시 그 사람을 해결하지 못했습니까? – Ted