开发者

Determine if Magento module is enabled

What is the best way to determine if a particular module is enabl开发者_运维问答ed/active in Magento? I've tried using class_exists to check if my code has been loaded and parsed by PHP but lately I've noticed its pretty unreliable (returns true even when I delete the module's .xml configuration).

Is there a core function I can call?


If you would like to use a build in function just use

Mage::helper('core')->isModuleEnabled(<module name>);

It is implemented in

Mage_Core_Helper_Abstract


Here's another option that is a more elegant way of finding out the status:

Mage::getConfig()->getModuleConfig('modulename')->is('active', 'true')
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜