php - Using the event-manager with multiple 'attachments' -


i'm trying use zend event-manager , have attachments 2 classes. try trigger events , go thru every attached function. somehow i'm able receive 1 event , never other events. can please point me in right direction?

// create event-manager public static function geteventmanager() {     if(!self::$eventmanager) {         self::$eventmanager = new \zend_eventmanager_eventmanager();     }     return self::$eventmanager; }  // attach event item\plugin::geteventmanager()->attach("item.getprovider", function($e) {     $item = $e->getparam("item");     return $this; });  // attach event in class item\plugin::geteventmanager()->attach("item.getprovider", function($e) {     $item = $e->getparam("item");     return $this; });  // events attached $results = self::geteventmanager()->trigger("item.getprovider", null, array("item" => $item), function($v) {     return ($v instanceof item); });  if($results->stopped()) {     $provider = array();      foreach($results $result)     {         $provider[] = $result;     }         return $provider;     } } 

http://pastie.org/10522533#


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -