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.
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');
getModuleDir only works where the first parameter is 'etc', 'controllers', 'sql', or 'locale'. Of course, you could just pass in a '' as the first parameter and append 'Model'/'Block'/'Helper' to the returned value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With