我在配置 smarty 3.1.12 版本时遇到了一些问题。
当我尝试从数据库中提取一些数据时,它运行“致命错误:在 F:...\smarty\sysplugins\smarty_internal_templatebase.php 第 47 行调用非对象上的成员函数 createTemplate()”
但是如果程序没有从数据库中提取,它运行正常。例如:
<?php
include "smarty/smarty.class.php";
$smarty->assign('title', 'I'm title');
$smarty->assign('content', 'I'm content');
$smarty->display('test.html');
?>
下面是我正在使用的代码。
公司.php
<?php
// Load smarty class file.
require("sys.smarty.php");
$smarty = new Smarti();
?>
系统.smarty.php
<?php
// Load smarty class file.
require("smarty/smarty.class.php");
class Smarti extends Smarty{
function Smarti() {
$this->setTemplateDir("../smarty/templates");
$this->setConfigDir("../smarty/configs");
$this->setCompileDir("../smarty/templates_c");
$this->setCacheDir("../smarty/cache");
}
}
?>
我不知道哪里出错了。我可以通过其他方式从数据库中提取数据,所以这不是数据库问题。你们能帮帮我吗?谢谢~