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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

dataset - MPAndroidchart returning no chart Data available -

post - imageshack API cURL -