Book Image

Magento 1.8 Development Cookbook

By : Bart Delvaux, Nurul Ferdous
Book Image

Magento 1.8 Development Cookbook

By: Bart Delvaux, Nurul Ferdous

Overview of this book

<p>Magento is an open source e-commerce platform which has all the functionality to function from small to large online stores. Its architecture makes it possible to extend the functionalities with plugins where a lot of them are shared by the community. This is the reason why the platform is liked by developers and retailers.</p> <p>A practical developer guide packed with recipes that cover all the parts of Magento development. The recipes will start with the simple development exercises and get the more advanced as the book progresses. A good reference for every Magento developer!</p> <p>This book starts with the basics. The first thing is to create a test environment. Next, the architecture, tools, files and other basics are described to make you ready for the real work.</p> <p>The real work starts with the simple things like theming and catalog configuration. When you are familiar with this, we will move on to more complex features such as module and database development. When you have survived this, we will move on to the last part of making a shop ready for launch: performance optimization and testing. This book will guide you through all the development phases of Magento, covering the most common pitfalls through its recipes.</p>
Table of Contents (19 chapters)
Magento 1.8 Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Registering blocks, helpers, and models


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.

Getting ready

Open the config.xml file of the Packt_Helloworld module. This file is located at app/code/local/Packt/Helloworld/etc/config.xml.

How to do it...

In the following steps, we will add configuration to the module to register the blocks, helpers, and models:

  1. 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>
  2. Create the app/code/local/Packt/Helloworld/Block folder.

  3. 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&gt...