The first thing we have to do is to register the resource models. The normal models are used to write business logic. The resource models are used to interact with the database.
We have to add an extra configuration in the config.xml
file of the module. Open the app/code/local/Packt/Helloworld/etc/config.xml
file.
The following steps explain how to register resource models in the existing Packt_Helloworld
module:
Navigate to the tag where the models are registered. This is in the
config/global/models
tag.Add the following configuration in it to add the resource models. Your
<global>
tag will look as follows:<global> <blocks> <helloworld> <class>Packt_Helloworld_Block</class> </helloworld> </blocks> <helpers> <helloworld> <class>Packt_Helloworld_Helper</class> </helloworld> </helpers>...