Reputation: 198
When calling Partner
model from component it is showing error.
App::import("MyPlugin.Model", "Partner");
$objPartner = new Partner();
Fatal error: Class 'Partner' not found in D:\htdocs\myapp\app\Plugin\MyPlugin\Controller\Component\TestComponent.php on line 287
Upvotes: 2
Views: 2496
Reputation: 21743
Never use App::import. Always either use loadModel in controller or shell scope or the always working
$Partner = ClassRegistry::init('Partner');
Upvotes: 6