how to get module path in magento?

how to get custom extension or module path in magento. if we know that than we can easily access any module folder path like Helper, controllers, sql , Block ,etc path and it’s help us to developed any module.


// Get module etc file path.
Mage::getModuleDir(‘etc’, ‘NameSpace_ModuleName’); // NameSpace_ModuleName => Mage_Core

// Get module sql file path.
Mage::getModuleDir(‘sql’, ‘NameSpace_ModuleName’);

// Get module controllers file path.
Mage::getModuleDir(‘controllers’, ‘NameSpace_ModuleName’);

// Get module Model file path.
Mage::getModuleDir('Model', ‘NameSpace_ModuleName’);

// Get module Block file path.
Mage::getModuleDir('Block', ‘NameSpace_ModuleName’);

// Get module Helper file path.
Mage::getModuleDir('Helper', ‘NameSpace_ModuleName’);

Here Mage::getModuleDir method allows you to get directory path information.

Leave a Reply