<?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软件时遇到错误,我没有从这段代码中得到线索。
发布于 2018-07-21 21:39:36
要调用父构造函数,必须使用
parent::__construct();代替parent::Smarty();
https://stackoverflow.com/questions/51456589
复制相似问题