- 论坛徽章:
- 0
|
这个是index.php代码:
<?php
require ('../../libs/Smarty.class.php');
$smarty = new Smarty;
$smarty->template_dir = "smarty/templates/templates";
$smarty->compile_dir = "smarty/templates/templates_c";
$smarty->config_dir = "smarty/templates/config";
$smarty->cache_dir = "smarty/templates/cache";
$smarty->caching = false;
$hello = "Hello World!";
$smarty->assign("hello",$hello);
$smarty->display('index.tpl');
?>
这个是index.tpl的代码:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Smarty</title>
</head>
<body> {$hello} </body>
</html>
但是我运行index.php出错.错误提示是:
Warning: Smarty error: unable to read resource: "index.tpl" in E:\AppServ\www\xinjian\smarty\libs\Smarty.class.php on line 1092
这个是什么意思?我觉得没哪错啊.到底怎么了?我刚接触模板,请高手们指教!!谢谢拉!!! |
|