From: http://agiletoolkit.org/learn/understand/model/add
class Model_MyModel extends Model_Table {
function init(){
parent::init();
$this->addField('name');
}
}
From: http://agiletoolkit.org/intro/models
class Model_MyModel extends Model_Table {
function defineFields(){
parent::defineFields();
$this->addField('name');
}
}
Which is correct? What’s the difference?
using the init() method is the right one. defineField is old way and was changed in favor of “init” due to consistency.
I will update the pages accordingly.