Reputation: 135
like this:
<models>
<contactform>
<class>Chandan_Contactform_Model</class>
<resourceModel>contactform_resource</resourceModel>
</contactform>
<contactform_resource>
<class>Chandan_Contactform_Model_Resource</class>
<entities>
<contactform>
<table>contactform_contact_list/table>
</contactform>
</entities>
</contactform_resource>
</models>
app/code/local/Chandan/Contactform/controllers/IndexController's indexAction() is like this ::
$contact = Mage::getModel("contactform/contact"); $contact->load($params['id']);
app/code/local/Chandan/Contactform/Model/Contact.php is like this ::
class Chandan_Contactform_Model_Contact extends Mage_Core_Model_Abstract { protected function _construct() { $this->_init('contactform/contact'); }
}
However, it is giving me this error : Can't retrieve entity config: chandan_contactform/contact
What I am missing here? Any help is highly appreciated.
Upvotes: 2
Views: 3921
Reputation: 7611
Your class name is wrong
and also model files path .
if you using Mage::getModel("contactform/contact");
then file structure
should be
Chandan>Contactform>Model>Contact.php
Chandan>Contactform>Model>Resource>Contact.php
Chandan>Contactform>Model>Resource>Contact>Collection.php
Check the link
Also issue in is not closed.
<class>Chandan_Contactform_Model_Resource/class>
to
<class>Chandan_Contactform_Model_Resource</class>
Upvotes: 2