我已经在本地编写了代码,一切正常,我尝试将其导入新系统并收到当前错误:
Warning: Missing argument 1 for Properties::__construct(), called in
/home/hghdigib/public_html/system/core/init.php on line 18 and defined in
/home/hghdigib/public_html/classes/properties_data.php on line 8
页面显示功能
include( str_replace('/core/', '/system/core/init.php', MODX_CORE_PATH) );
$db = new Mysqlidb('localhost','user','pass','database');
$properties = new Properties($db);
$properties->showLatest(3);
初始化文件
define('CORE_PATH', dirname(__FILE__));
try
{
require_once("classes/database.php");
require_once("classes/properties_data.php");
require_once("classes/xml_upload.php");
}
catch (Exception $e)
{
die('Error loading system.');
}
Properties_data.php 第 1-8 行
class Properties {
public $db;
function __construct($db) {
$this->db = $db;
}
谢谢