Include A Module Into Another Module

Hello everybody,

Well, if a module requires another module in order to properly function, how can I define this relation?

for example:

there is module A

and there is a new module named B

B requires module A in order to do something, but module B does not contain module A

When installing module B in to the application, and test it, how can I make it emit a message that should state that module A is missing? Is this possible?

just test dependent modules presence in init() function…

10x

I’v done something like this:

in init() function of the module:


if (!Yii::app()->hasComponent('A') || get_class(Yii::app()->getComponent('A')) != "A") {

    throw new CException('Extension A is required in order for ' . $this->id . ' module to properly function.');

}

actually module A is not a module but an extension, but it is not important for this instance… :)