FAQ #44

Question: How do I use a model from within a component? Answer: Use the init method of the ClassRegistry class.
//in your component
$Book=ClassRegistry::init('Book');
$books=$Book->find('all');
Warning:
Cake PHP does not recommend using models in components!
Add comment