我正在尝试按照 Jobeet 教程(http://agiletoolkit.org/learn/tutorial/jobeet/day3)中提到的方式进行 CRUD。我还在页面目录中添加了一个 generate.php ,其中包含链接中提到的代码。当我尝试通过浏览器通过http://localhost/atk4.1.2/?page=generate访问它时,我收到以下错误,
Exception_ForUser
You should call parent::init() when you override it
Additional information:
- object_name: gift_project_generate
- class: page_generate
我还在页面目录中添加了一个名为 crud.php 的页面,其内容如下,
<?php
class page_crud extends Page{
function init(){
parent::init();
$tabs=$this->add('Tabs');
$tabs->addTab('Gifts')->add('CRUD')->setModel('Gift');
}
}
下面是Model目录里面的Gift.php,
<?php
class Model_Gift extends Model_Table {
function init(){
parent::init();
$this->addField('id');
$this->addField('name')->type('text');
$this->addField('url')->type('text');
}
}
现在,当我尝试通过http://localhost/atk4.1.2/?page=crud访问 crud 页面时,我看到以下错误,
Exception_InitError
You should define entity code for Model_Gift
C:\xampp\htdocs\atk4.1.2\atk4\lib\BaseException.php:37
但是数据库已经有一个名为gift 的表,并且$this->dbConnect();
在Frontend.php 中没有注释。
我在这里错过了什么吗?