Magento – Generic path to a module in Magento

magento

Is there a generic way to receive the path to a Magento module? I want to link to an configuration file in the /etc folder in one of my modules.

Best Solution

You can ask for paths with getModuleDir method

Mage::getModuleDir('Model', 'Your_Extension');
Mage::getModuleDir('Block', 'Your_Extension');
Mage::getModuleDir('Helper', 'Your_Extension');
Mage::getModuleDir('controllers', 'Your_Extension');
Mage::getModuleDir('etc', 'Your_Extension');
Related Question