There are currently three methods for including and using models inside your controller. I am referring to the case when your controller does not belong to a model or or the model is not related to the model inside the controller you are working in. Although this case should be extremely rare, it seems to happen to me a lot. This post is basically a re-summary of Gwoo’s response in the CakePHP Google Groups discussion.
This method actually calls ClassRegistry::init() and saves the instance of the model as a parameter in the controller.
Controller::loadModel('Car'); $cars = $this->Car->find('all');
This method creates an instance of the Model and returns it for use.
$car = ClassRegistry::init('Car'); $cars = $car->find('all');
3. App:import() (not recommended)
This method only includes the file. This requires you to create an instance each time.
App::import('Car'); $car = new Car(); $cars = $car->find('all');
As you can see this is really simple and basic stuff. However, I felt the need to re-post this information. If for nothing else, I will be using this as a reference point for myself
Update 5/27/09: Miles Johnson has a nice write up on this on his blog