Jump to content

Check if another module is attached


playdewu

Recommended Posts

The Module class has a function named "isRegisteredInHook", where you pass the hook name

 

So in your install function, you can use the Module function getInstanceByName to get an instance of the other module, and then use isRegisteredInHook to see if the module is hooked

$othermodule = Module::getInstanceByName('module_name');
if (!$othermodule->isRegisteredInHook('hook_name'))
{
     //add your code to register the module to the hook, something like....
     $othermodule->registerHook('hook_name');
}

The above code is not tested, but should work

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...