function __construct()
{
if(phpversion()<5)
{
$this->Model();
}
else
{
$this->_assign_libraries( (method_exists($this, '__get') OR method_exists($this, '__set')) ? FALSE : TRUE );
// We don't want to assign the model object to itself when using the
// assign_libraries function below so we'll grab the name of the model parent
$this->_parent_name = ucfirst(get_class($this));
log_message('debug', "Model Class Initialized");
}
}
哦,我回去检查检查 你这样写也不应该会造成两个实例冲突吧,CI 不可能控制 PHP 的类行为。 关于构造函数, PHP 5 在类中找不到 __construct() 函数,它就会尝试寻找旧式的构造函数,所以不用那么修改视乎也可以 楼上说的没错,PHP5 是向下兼容的,否则就世界大乱了!呵呵 楼主将子类中 $table;设为private $table;试试,public $table 在两子类中同时被使用,可能会引起冲突,后者覆盖前者。 用echo逐行调试吧,可能是代码哪里写混淆了
页:
1
[2]