Skip to main content
3 of 3
added 4 characters in body
Aaron Allen
  • 9k
  • 2
  • 27
  • 36

You can use the ComponentRegistrar by injecting ComponentRegistrarInterface and get a module's directory like this:

$path = $this->componentRegistrar->getPath(ComponentRegistrar::MODULE, 'Your_Module');

Since all modules are required to register their directory with this class in their registration.php file, it doesn't seem like something magento would change.

Aaron Allen
  • 9k
  • 2
  • 27
  • 36