public function createService(ServiceManager $serviceManager)
 {
     $listeners = $serviceManager->getServiceConfig('listeners', array());
     $listeners = array_merge($this->defaultListeners, $listeners);
     $eventManager = new EventManager();
     foreach ($listeners as $listener) {
         $eventManager->attach(new $listener());
     }
     return $eventManager;
 }
 public function attach(EventManager $eventManager)
 {
     $eventManager->attach(MvcEvent::REQUEST, array($this, 'onRoute'));
 }
 public function attach(EventManager $eventManager)
 {
     $eventManager->attach(MvcEvent::RESPONSE, array($this, 'onResponse'));
 }
 public function attach(EventManager $eventManager)
 {
     $eventManager->attach(MvcEvent::REQUEST, array($this, 'onRequest'), -1);
 }
 public function attach(EventManager $eventManager)
 {
     $eventManager->attach(MvcEvent::DISPATCH, array($this, 'onDispatch'));
 }
 public function attach(EventManager $eventManager)
 {
     $eventManager->attach(MvcEvent::RENDER, array($this, 'onRender'), -1);
 }