I have an independent module A, and a different module B. Module A is independent and should work without module B, but whenever module B is installed with module A, I want to be able to use module B’s services and classes.
I have read in the documentation that one module can only access another module’s services if it is marked as required. However, if I do this, then my module A can’t exist independently. Will aware_of_module work? If not, is it even possible to do what I said above, or is there a workaround?
Yes, I already read the documentation, and it said under the Requiring Modules section that “A module can only access the api/service of another module if it is marked as required.” Hence, I assumed that aware_of_module could not do it.
But as I tried using aware_of_module, it gave me a BeanCreationException error.
I also use programmatic checking if a certain module is installed before I start using a service method from it, however, I still need the dependency for my module A to be able to use methods/service from module B.
Thank you for all the replies. I used aware_of_module and it worked. I just wasn’t aware that it had to be placed on top of require_module in the config.xml file. Placing it below caused it to have errors.