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.
Best Answer
After some study of Magento core modules, I checked the source, from where the following command is executed:
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:
Also, tons of thanks to @sanne, who helped me to go in the right direction.