/** * Listener for the `module.enable` event. * * Called after a module has been successfully enabled. * Receives `$modinfo` as args. * * @param ModuleStateEvent $event The event instance. */ public function moduleEnabled(ModuleStateEvent $event) { parent::moduleEnabled($event); // you can access general data available in the event // the event name // echo 'Event: ' . $event->getName(); // type of current request: MASTER_REQUEST or SUB_REQUEST // if a listener should only be active for the master request, // be sure to check that at the beginning of your method // if ($event->getRequestType() !== HttpKernelInterface::MASTER_REQUEST) { // // don't do anything if it's not the master request // return; // } // kernel instance handling the current request // $kernel = $event->getKernel(); // the currently handled request // $request = $event->getRequest(); }
/** * Listener for the `module.enable` event. * * Called after a module has been successfully enabled. * Receives `$modinfo` as args. * * @param ModuleStateEvent $event The event instance. */ public function moduleEnabled(ModuleStateEvent $event) { parent::moduleEnabled($event); }