![]() |
|
首页 │ Apache │ Linux│ Java│ MySQL│ 注册│帮助 | |||
相关问题
Smarty.php:
<?php
/*-------------------加载模板----------------*/
include "Smarty/libs/Smarty.class.php";
define('__SITE_ROOT', 'd:/home/Smarty');
$tpl = new Smarty();
$tpl->Smarty();
$tpl->template_dir = './templates/';
$tpl->compile_dir = './templates_c/';
$tpl->config_dir = './configs/';
$tpl->cache_dir = './cache/';
$tpl->left_delimiter = '<{';
$tpl->right_delimiter = '}>';
$tpl->caching = false;
?>
<?
/*-------------创建实例----------------------*/
$tp = new smarty();
$tp->assign("title", "标题");
$tp->assign("content", "内容");
$tpl->display('test.htm');
?>
test.htm内容如下:
<{$content}>
运行Smarty.php,显示错误,
Warning: Smarty error: unable to read resource: "test.htm" in D:\home\Smarty\libs\Smarty.class.php on line 1088
提问者:eays 08-17 17:05
答复

