Book Image

Magento PHP Developer's Guide

By : Allan MacGregor
Book Image

Magento PHP Developer's Guide

By: Allan MacGregor

Overview of this book

<p>Magento has completely reshaped the face of e-commerce since its launch in 2008. Its revolutionary focus on object oriented and EAV design patterns has allowed it to become the preferred tool for developers and retailers alike.</p> <p>"Magento PHP Developer’s Guide" is a complete reference to Magento, allowing developers to understand its fundamental concepts, and get them developing and testing Magento code.</p> <p>The book starts by building the reader’s knowledge of Magento, providing them with the information, techniques, and tools that they require to start their first Magento development.</p> <p>After building this knowledge, the book will then look at more advanced topics: how to test your code, how to extend the frontend and backend, and deploying and distributing custom modules.</p> <p>"Magento PHP Developer’s Guide" will help you navigate your way around your first Magento developments, helping you to avoid all of the most common headaches new developers face when first getting started.</p>
Table of Contents (16 chapters)
Magento PHP Developer's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Setting up our routes


Now that we are capable of saving and manipulating the data by using our models, we need to provide a way for customers to interact with the actual gift registries; that is our first step. We need to create valid routes or URLs in the frontend.

As with many things in Magento, this is controlled by the configuration file. A route will convert a URL into a valid controller, action, and method.

Open our config.xml file. The file location is app/code/local/Mdg/Giftregistry/etc/config.xml. Refer to the following code:

<config>
…
    <frontend>
        <routers>
            <mdg_giftregistry>
                <use>standard</use>
                <args>
                    <module>Mdg_Giftregistry</module>
                    <frontName>giftregistry</frontName>
                </args>
            </mdg_giftregistry>
        </routers>
    </frontend>
…
</config>

Let's break down the configuration...