我正在使用 ATK4 开发一个网站,这是一个带有 jquery 的 php 框架。
我在笔记本电脑上使用 localhost/test1 作为目录并使用本地 php 数据库开发了它。
如果我将所有目录在线移动并将 php 数据库导入到我的网络主机,大多数页面都可以工作,但在一个页面上,我在其中一个页面上收到错误指示
致命错误:在第 131 行的 /homepages/4/d184034614/htdocs/paperless/atk4/lib/AbstractObject.php 中找不到类“model_TaskType”
AbstractObject.php 中引用的行是 add 函数的一部分。
该模型存在,并且完全相同的代码在 localhost 上运行。其他页面也有模型并且似乎工作正常。该表在两个数据库上具有完全相同的结构。
该模型没有在有问题的页面中直接引用,它是一个引用模型的 refModel。这里是否有一些路径问题不会出现在 localhost 上?
TaskType 模型看起来像这个类 Model_TaskType extends Model_Table { public $entity_code='vscrum_tasktype'; 公共 $table_alias='ty';
function init(){
parent::init();
$this->addField('id')->mandatory(true);
$this->addField('name')->mandatory(true);
$this->addField('budget_code')->mandatory(true);
$this->addField('colour_desc')->refModel('model_Colour');
$this->addField('project_id');
$this->addField('team_id');
$this->addField('company_id');
$this->addCondition('team_id',$this->api->getTeamID());
}
}
并且添加到有问题的页面的任务模型看起来像这样
class Model_Task extends Model_Table {
public $entity_code='vscrum_task';
public $table_alias='tk';
function init(){
parent::init();
// debug causes error in Ajax in ATK v4.1.1
// $this->debug(true);
$this->addField('id')->system(true)->visible(false);
$this->addField('story_id')->system(true)->visible(false);
$this->addField('backlog_ref')->system(true)->visible(false);
$this->addField('sprint_id')->system(true)->visible(false);
$this->addField('team_id')->system(true)->visible(false);
$this->addField('status')->defaultValue('I')->visible(false);
$this->addField('task_desc')->mandatory(true)->visible(true);
$this->addField('points')->mandatory(true)->defaultValue(1)->datatype('numeric');
$this->addField('member_id')->mandatory(true)->refModel('model_Member');
// join colour
$this->addRelatedEntity('ty','vscrum_tasktype','tasktype_id','left');
//tasktype
$this->addField('tasktype_id')->refModel('model_TaskType')->mandatory(true);
}
}
也许我错过了一些明显的东西,任何想法为什么这在 localhost 上可以正常工作但在我的网络主机上中断?