I need to load a Model in a component to save the Data of that related model in that component itself.
My Component name is ImagemuploadComponent
In this Component I want to load the Attachement Model. I've tried the following code but it did't worked. (Which works fine in cakephp 1.3)
$Attachment = ClassRegistry::init('Attachment');
$this->loadModel('Attachment');
Try this code. This will import your model and instantiate.
After this you can perform any operation as controller.
App::import('Model','Attachment');
$this->Attachment = &new Attachment();
$this->Attachment->save($your_data);