What is difference between bindModel and loadModel in cakephp 2.x? Which one is best to use in search query.
Asked
Active
Viewed 242 times
-4
-
2Reading the book.cakephp.org and api.cakephp.org is a to hard task to answer these very basic questions? A huge part of software development involves the ability to read and understand documentation, that's usually the first step. – floriank Aug 08 '14 at 13:42
-
I need to know the internal processing of of both loadModel and bindModel? – KS Rajput Aug 14 '14 at 11:44
-
The doc blocks above the methods explain usually what they do, that's what api.cakephp.org is for - API documentation. The book itself has a ton of additional information and very often examples as well. Besides that, the methods names in this case already imply what the difference might be, the doc blocks explain it and the book shows you how to use them. – floriank Aug 14 '14 at 23:56
-
If you don't know the answer then why are you give me down vote? – KS Rajput Sep 15 '14 at 13:12
1 Answers
1
bindModel and loadModel have no relationship. Both are completely different from each other.
Use of bindModel
When you want to relationship between two model then you have to use bindModel.
Use of loadModel
When you want to load data of different model in Controller then you have to use loadModel.
If I have UsersController and I want Post Model data in User Controller then I have to Use like
$this->loadModel('Post');
$this->Post->find('all');

Sadikhasan
- 18,365
- 21
- 80
- 122
-
I know both are different but i need to know internal processing of both? Why we use loadModel and why we use bindModel because we can get result with use of both. then why many times we use bindModel not loadModel? And in which conditions we should use loadModel and bindModel. – KS Rajput Aug 14 '14 at 11:39