转到在线时找不到ATK4模型 [英] ATK4 model not found when moving to online

查看:94
本文介绍了转到在线时找不到ATK4模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ATK4开发一个网站,这是一个带有jquery的 php框架.

I am developing a website using ATK4, a php framework with jquery.

我已经使用localhost/test1作为目录并使用本地php数据库在笔记本电脑上开发了此软件.

I have developed this on my laptop using localhost/test1 as the directory and with a local php database.

如果我将所有目录在线移动并将php数据库导入到我的虚拟主机,则大多数页面都可以工作,但是在一个页面上,我会在指示

If i move all the directories online and import the php database to my web host, most of the pages work but on one, i get an error on one of the pages indicating

致命错误:在第131行的/homepages/4/d184034614/htdocs/paperless/atk4/lib/AbstractObject.php中找不到类'model_TaskType'

Fatal error: Class 'model_TaskType' not found in /homepages/4/d184034614/htdocs/paperless/atk4/lib/AbstractObject.php on line 131

AbstractObject.php中引用的行是add函数的一部分.

The line referred to in AbstractObject.php is part of the add function.

该模型存在,并且完全相同的代码在localhost上运行.其他页面也有模型,并且工作正常.该表在两个数据库上的结构完全相同.

The model is present and exactly the same code is working on localhost. Other pages also have models and appear to be working fine. The table has exactly the same structure on both databases.

在存在问题的页面中未直接引用该模型,它是所引用模型的refModel.这里是否存在一些在本地主机上不显示的路径问题?

The model is not directly referenced in the page that has a problem, it is a refModel to a Model which is referenced. Is there some path issue here that doesnt present itself on localhost ?

TaskType模型如下所示 class Model_TaskType扩展了Model_Table { 公共$ entity_code ='vscrum_tasktype'; public $ table_alias ='ty';

The TaskType model looks like this class Model_TaskType extends Model_Table { public $entity_code='vscrum_tasktype'; public $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());
  }

}

,添加到有问题的页面的任务模型如下所示:

and the Task Model which is added to the page with the problem looks like this

  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上正常工作却在我的Webhost上中断的任何想法?

Maybe i've missed something obvious, any ideas why this would work fine on localhost but break on my webhost ?

推荐答案

 Class 'model_TaskType' not found in 

您应始终使用大写字母.

you should always use exact capitalization.

如果您有Model_TaskType,则将其添加到CRUD后应为Model_TaskType.

if you have Model_TaskType, it should be Model_TaskType when added to CRUD.

也是这个地方:

$this->addField('tasktype_id')->refModel('model_TaskType')->mandatory(true);

应为:

$this->addField('tasktype_id')->refModel('Model_TaskType')->mandatory(true);

在寡妇上,文件名大写没有区别,就像在Linux中一样.

On widows, file name capitalization does not make a difference, where as in linux it does.

这篇关于转到在线时找不到ATK4模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆