致命错误:调用未定义的方法Smarty::Smarty()


<?php 
require_once  SMARTY_DIR . 'Smarty.class.php';
class Application extends Smarty 
{
public function __construct()
{
parent::Smarty();
$this->template_dir = TEMPLATE_DIR;
$this->compile_dir = COMPILE_DIR;
$this->config_dir = CONFIG_DIR;
}
}
?>

我得到错误作为致命错误:调用未定义的方法Smarty::Smarty((
我在php项目文件夹中使用了Smarty软件但是我犯了错误我第一次在php中使用这个Smarty软件我在这个代码中没有得到线索

要调用父构造函数,必须使用

parent::__construct();

而不是parent::Smarty();

最新更新