In Magento, We can check any module is to enable or disable using a simple code snippet.
Call Magento\Framework\Module\Manager class to__construct() for check module status.
isEnabled() module used to display the result of the Module Enable or Disable with the boolean value true/false.
<?php
namespace Rbj\Training\Block;
class Modulemanager extends \Magento\Framework\View\Element\Template
{
protected $_moduleManager;
public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
\Magento\Framework\Module\Manager $moduleManager,
array $data = []
)
{
$this->_moduleManager = $moduleManager;
parent::__construct($context, $data);
}
/* return bool */
public function isModuleEnable()
{
return $this->_moduleManager->isEnabled('Magento_Review');
}
}
Call from template,
$isEnable = $block->isModuleEnable();

