Book Image

Magento PHP Developer????s Guide, 2nd Edition

By : Allan MacGregor
Book Image

Magento PHP Developer????s Guide, 2nd Edition

By: Allan MacGregor

Overview of this book

Table of Contents (16 chapters)
Magento PHP Developer's Guide Second Edition
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. Our first step is to need to create valid routes or URLs for the frontend.

As are 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 and insert the following code, located at app/code/local/Mdg/Giftregistry/etc/config.xml:

<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 code we just added:

  • <frontend>: Previously, we added all the configurations...