Magento doesn’t require words for appreciation just pull out the records and check how many online stores are using Magento. Magento indeed has brought sweeping changes to the market. It is a culmination of all the great features of other online shopping carts including those which other lacks.

Once you have setup an online store, things doesn’t stop there. You will find amazing Magento modules to enhance the functionality of your site. You will find lot of flexibility in developing Magento Modules or in case you would like to customize existing ones. But at the same time this development requires advance programming skills. Today we’ll shed some light on the very basics of Magento development.

Magneto introduces object oriented approach in using PHP as programming language to develop highly scalable and optimized Magento Modules. It requires MySQL to be used for database. Familiarity with XML is a must to have because most of the configuration in development involves playing around with XML. Next thing you should know is the MVC (Model View Controller) approach. PHP uses MVC as its framework by default. Let us clarify this with the help of an example. A site visitor requests certain information about the product on your Magento site. This request [URL] is taken by the controller class which basically coordinates the processing of this request.

Controllers use models to bring any information against any product from the database. Once the information has been fetched by the model, controller will pass that information to the View object that will be responsible of rendering it to the layouts. Let us get some brief insight of how this stuff actually works. Suppose you have the following URL,

http://www.abc.com/moduleABC/controllerABC/functionABC

What happens when this URL is entered, function defined in a controller class ABC within a module ABC will be called.  This process is called dispatching whereas breaking up of URL into module, controller and function is called routing. One of the fantastic features of Magento is that it allows you to develop your own modules without changing its core files. Whenever you are developing a new plugin you need to create your own module within which all the relevant files will be placed for it e.g. Helpers, Controllers, Blocks, Observers etc.

In order to get your new module recognized by Magento there is a XML based configuration file called config.xml for each module that will define configuration for each model, controller, event etc. to be used in your module. Any Magento function that will serve for general purpose and is not restraint to any particular class is defined in Helper classes. As the name suggests they contain utility methods that will assist you throughout the program.

Now that you have created your module with required controller classes, models, blocks, layouts along with the configuration we are yet left with something highly desirable in most situations. Guess what! You are probably right if your answer is “Handling Events”. When a user login or logoff, clicks on any text or visits any page you can define many event handlers in your config.xml file called observers. Furthermore functions that should be executed can be defined in those handlers……

Advertisements