Hello,
For a given Module (ex: MyModule), how can I define that requires the Module A and Module B to work?
I read that this used to be configured in the option "requires" of the module.json file. But I also read that this feature is depracated.
Thank you.
There's nothing to do on this package level for that.
Dependencies in PHP are handles by Composer, you can use this to define dependencies.
@nWidart,
I guess you didn't understand my request. I was talking about dependency between Modules of this package.
A better example: I have two modules: Users and Buys, but for the module Buys to work, this module require that the module Users exists and is enabled.
Thank you and sorry if I didn't explain well what I wanted to mean.
Hi,
I think I understood the request correctly. Modules are packages, thus you can use composer to define dependencies to other modules too.
@nWidart ,
Oh, ok. :)
So, you're saying that the composer.json file of module Buys I need to had this:
"require": {
"module_name": "version"
}
Thank you.
Yup indeed, a module acts just like any other package.