2013年10月21日 星期一

[CakePHP] Call another Controller's method from a Controller

Use RequestAction() carefully:

$itemD = $this->requestAction(array('controller'=>'items', 'action'=>'findByItId', 'it_id' => $item['it_id']));


http://stackoverflow.com/questions/13947393/cakephp-importing-one-controller-inside-another-controller



If models have been linked (using hasMany, belongsTo, etc.) :

$supplier=$this->Delivery->Supplier->findBySpId($sp_id);

沒有留言:

張貼留言

日常秘技小輯錄

媽媽傳授: 用爉燭塗在線上縫紉,可以更容易打結,以及拉縫線更順 爸爸傳授: 貼玻璃紙前在玻璃面塗上肥皂水,可以移動玻璃紙不留摺痕