You can get the list of all Enable module in Magento 2. You can manually check your all the enable module list from app/etc/config.php file module name with status set to 1.
‘Magento_Store’ => 1 Store Module is Enable.
‘MSP_ReCaptcha’ => 0 Recaptcha Module is disable.
You can get all the Active module list using Magento\Framework\Module\ModuleList class. ModuleList class used for getting all the active module list.
Check via Programmatically,
<?php
public function __construct(
\Magento\Framework\Module\ModuleList $enabledModuleList
) {
$this->enabledModuleList = $enabledModuleList;
}
/**
* Return all the enable module
*
* @return Array
*/
public function getAllEnableModule() {
$enableModules = $this->enabledModuleList->getNames();
return $enableModules;
}
Call function from PHP file or template file, $this->getAllEnableModule();
Result will be array of all the active module,
Array
(
[0] => Magento_Store
[1] => Magento_Directory
[2] => Magento_Theme
[3] => Magento_Backend
[4] => Magento_Variable
[5] => Magento_Eav
[6] => Magento_AdminNotification
[7] => Magento_Indexer
[8] => Magento_Config
[9] => Magento_Authorization
[10] => Magento_Customer
[11] => Magento_Cms
[12] => Magento_Catalog
...
)
You can check the Get dependent module list for a specific module Magento 2

3 Replies to “Magento 2 Get all the Enable (Active) module list programmatically.”