$sm = $e->getApplication()->getServiceManager();
$routeMatch = $sm->get('router')->match($sm->get('request'));
if (!empty($routeMatch)){
$routeName = $routeMatch->getMatchedRouteName();
$module = explode('/', $routeName);
if (!empty($module[0]))
if ($module[0] == 'melis-backoffice'){
// attach listeners for Melis
(new \ModuleTpl\Listener\SavePropertiesListener())->attach($eventManager);
(new \ModuleTpl\Listener\DeleteListener())->attach($eventManager);
}
}
|