When we want to perform operations on our module, we have to use blocks, models, and helpers. In this recipe we will register these object types with the right class prefix.
Open the config.xml
file of the Packt_Helloworld
module. This file is located at app/code/local/Packt/Helloworld/etc/config.xml
.
In the following steps, we will add configuration to the module to register the blocks, helpers, and models:
Register the blocks by adding the following configuration in the
config.xml
file. Add the following XML code as a child of the<config>
tag:<global> <blocks> <helloworld> <class>Packt_Helloworld_Block</class> </helloworld> </blocks> </global>
Create the
app/code/local/Packt/Helloworld/Block
folder.Repeat step 1 and step 2 to register the helpers and models. Your global tag will look similar to the code shown as follows:
<global> <blocks>...