php - CakePhp model name conventions -
i using cakephp,
$this->calldetail->save($data);
database table name calldetails
and class code
class calldetail extends appmodel { var $name = "calldetail"; }
however calldetail not working, should change model name to
it seems not load model. first have load model in controller. there 2 way load model
one loadmodel
$this->loadmodel('article');
another $uses variable
public $uses = array('article');
update
or can use $usetable specify table name
public $usetable = 'exmp'; // model uses database table 'exmp'
Comments
Post a Comment