O'Reilly logo

Magento 1.4 Development Cookbook by Nurul Ferdous

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a controller for the module

A controller plays a vital role in mapping URL to a specific business logic. In Magento, a controller extends the Magento's front controller, which is ultimately linked with Zend Framework's front controller via Varien front action controller. In this recipe, we will create some controllers both for frontend and backend activities.

How to do it...

  1. Create a new file named IndexController.php in the app/code/local/Packt/News/controllers/ directory.
  2. Paste the following code in the IndexController.php file. If it's not empty then make it empty and paste the following code:
    <?php class Packt_News_IndexController extends Mage_Core_Controller_Front_Action { public function indexAction() { $resource = Mage::getSingleton('core/resource'); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required