/** * Listener for the `module.postinstall` event. * * Called after a module has been installed (on reload of the extensions view). * Receives `$modinfo` as args. * * @param ModuleStateEvent $event The event instance. */ public function modulePostInstalled(ModuleStateEvent $event) { parent::modulePostInstalled($event); $module = $event->getModule(); if ($module === null) { return; } if ($module->getName() === 'ZikulaRoutesModule') { // Reload multilingual routing settings. \ModUtil::apiFunc('ZikulaRoutesModule', 'admin', 'reloadMultilingualRoutingSettings'); } $this->cacheClearer->clear('symfony.routing'); // dumping the JS routes after module install occurs in \Zikula\ExtensionsModule\Controller\AdminController::viewAction }
/** * Listener for the `module.postinstall` event. * * Called after a module has been installed (on reload of the extensions view). * Receives `$modinfo` as args. * * @param ModuleStateEvent $event The event instance. */ public function modulePostInstalled(ModuleStateEvent $event) { parent::modulePostInstalled($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.postinstall` event. * * Called after a module has been installed (on reload of the extensions view). * Receives `$modinfo` as args. * * @param ModuleStateEvent $event The event instance. */ public function modulePostInstalled(ModuleStateEvent $event) { parent::modulePostInstalled($event); $module = $event->getModule(); if ($module === null) { return; } if ($module->getName() === 'ZikulaRoutesModule') { // The module itself just got installed, reload all routes. $this->em->getRepository('ZikulaRoutesModule:RouteEntity')->reloadAllRoutes(); // Reload multilingual routing settings. \ModUtil::apiFunc('ZikulaRoutesModule', 'admin', 'reloadMultilingualRoutingSettings'); } else { $this->addRoutesToCache($module); } $this->cacheClearer->clear('symfony.routing'); // dumping the JS routes after module install occurs in \Zikula\Module\ExtensionsModule\Controller\AdminController::viewAction }