Magento module structure – Part 1

Magento module structure:

In this post will see, magento module folder structure and details. This post may helpful for magento learning people hope. I had referred some website like wiki and magento knowledge base website to gather this info. For more info please refer those links.

Namespace – Modulename – Block , controllers , etc , Helper , Model, sql

Example:

Here Jute is my Namespace and Catalog is on my module name

Jute – Catalog – Block , controllers , etc , Helper , Model, sql, data, Exception.php

Namespace:

Namespace will helpful to avoid the conflict between modules. Say for example am going to use same function in two modules like below

Module : 1

class myfuncnameclass{

public function myfunc(){ echo ” from module 1″; }

}

Module : 2

class myfuncnameclass{

public function myfunc(){ echo ” from module 2″; }

}

here my function name mufunc and declared my class name as like ” myfuncnameclass ” for both the module. Here same function if i try to use then may get conflict. In this scenario will avoid this kind of issue will use namespace.

Module : 1

class Mynamesapce1_myfuncnameclass{

public function myfunc(){ echo ” from module 1″; }

}

Module : 2

class Mynamesapce1_myfuncnameclass{

public function myfunc(){ echo ” from module 2″; }

}

 

——————————————————————————————————————————————————————–

Corner of Blog:

“Smoking Is Injurious To Health”

——————————————————————————————————————————————————————–

Leave a Reply