I am working on creating a base module for all other modules under one namespace.

I want to show a list of all modules (with their version and their status as enabled or disabled).

I have injected dependency of \Magento\Framework\Module\ModuleListInterface in my block file, but I am not getting the module in the list if I disable it.

I have tried getAll() and getNames() functions. No function is returning disabled module names in the list.

Previously it was possible to get the list of all modules because there was a section in admin panel (Advanced), where all modules were listed with respective module output.

Kindly help me to get the list of all modules.


After some study of Magento core modules, I checked the source, from where the following command is executed:

php bin/magento module:status

I found that Magento is using \Magento\Framework\Module\FullModuleList class to get the list of enabled and disabled modules.

Based on Magento's implementation, I have implemented my code in the following way:

namespace Mohit\Base\Block;

class Modules extends \Parent\Class
    protected $fullModuleList;

    public function __construct(
        \Magento\Framework\Module\FullModuleList $fullModuleList
    ) {

        $this->fullModuleList = $fullModuleList;

    public function modulesList()
        $allModules = $this->fullModuleList->getAll();

Also, tons of thanks to @sanne, who helped me to go in the right direction.

  • If we want to get a list of modules which exists in app/code directory, then what should I do ?? – iqbal malik Feb 13 '19 at 8:11

A shot in the dark here, but maybe you could look how the terminal function bin/magento module:status works and copy that somehow? Because that shows all modules and the statuses? No idea how though.

  • 1
    Thanks, @sanne for the answer. I had been checking the same while you answered. Upvoted for the precious help. – Mohit Kumar Arora Jul 19 '18 at 13:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.