1
是什么在CakePHP这两个命令的区别?
$this->Model->findbyId(7);
$this->Model->read(null, 7);
我想提高我的CakePHP的代码,不知道最好的办法是要求从数据库/视图个别项目,如什么/ $ ID。
我应该使用findbyId或阅读()?我甚至看到有人用一个id = $ ID条件( '第一')使用的发现。
是什么在CakePHP这两个命令的区别?
$this->Model->findbyId(7);
$this->Model->read(null, 7);
我想提高我的CakePHP的代码,不知道最好的办法是要求从数据库/视图个别项目,如什么/ $ ID。
我应该使用findbyId或阅读()?我甚至看到有人用一个id = $ ID条件( '第一')使用的发现。
read()
设置模型数据。这里也有一些好info at http://nuts-and-bolts-of-cakephp.com/2008/06/13/read-vs-find/。