我先在这里发布我的代码
索引.php:
<?php
require('class/smarty/Smarty.class.php');
$smarty = new Smarty;
$smarty->setTemplateDir('./templates/');
$smarty->setCompileDir('./template_c/');
$smarty->setCacheDir('./cache/');
$smarty->setConfigDir('./configs/');
$smarty->assign('name','Dan Brown');
$smarty->display('tpl_1.tpl');
?>
模板文件,tpl_1.tpl:
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>demo/title>
</head>
<body>
<h1>
hello,{$name}
</h1>
</body>
</html>
一切看起来都很好,但结果是输出空白页,smarty 无法显示或调用模板文件,我的代码哪里有问题。我真的把这个问题搞糊涂了,浪费了太多时间