我已经写在本地我的代码,一切工作正常,我试图将它导入到一个新的系统,并获取当前的错误:缺少参数1属性:: __结构(),
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);
的init.php
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;
}
感谢
编辑不是改进 – Dale
Wheres init.php line 18?我只看到前7行+ IDontKnow.php的一些行... – SergeS
你怎么不使用xPDO? –