public function createService(ServiceLocatorInterface $serviceLocator) { $flashMessenger = $serviceLocator->get('FlashMessenger'); $notification = new Notification($flashMessenger); $notificationListener = $serviceLocator->getServiceLocator()->get('Core/Listener/Notification'); $notification->setListener($notificationListener); return $notification; }
public function createService(ServiceLocatorInterface $serviceLocator) { $flashMessenger = $serviceLocator->get('FlashMessenger'); $notification = new Notification($flashMessenger); //$sharedListener = $serviceLocator->getServiceLocator()->get('SharedEventManager'); //$sharedListener->attach('*', NotificationEvent::EVENT_NOTIFICATION_HTML, array($notification,'createOutput') , 1); $notificationListener = $serviceLocator->getServiceLocator()->get('Core/Listener/Notification'); $notification->setListener($notificationListener); return $notification; }
public function createService(ServiceLocatorInterface $serviceLocator) { /* @var \Zend\Mvc\Controller\PluginManager $serviceLocator */ $services = $serviceLocator->getServiceLocator(); $flashMessenger = $serviceLocator->get('FlashMessenger'); $notificationListener = $serviceLocator->getServiceLocator()->get('Core/Listener/Notification'); $translator = $services->get('translator'); $notification = new Notification($flashMessenger); $notification->setListener($notificationListener); $notification->setTranslator($translator); return $notification; }