php - CakePHP not binding model automatically -
cakephp 2.8.3 not binding model automatically.
model :
<?php class item extends appmodel { public $name = 'item'; public $belongsto = array( 'cat' => array( 'classname' => 'cat', 'foreignkey' => 'cat_id', ), ); }
the above model not working.
however when bind model in controller. works fine.
$this->item->bindmodel(array( 'belongsto' => array( 'cat' => array( 'foreignkey' => 'cat_id', ))));
what cause ?
Comments
Post a Comment