public function attach(EventCollection $events) { $this->events = $events; $this->listeners[] = $events->attach('dispatch.error', array($this, 'renderError')); $this->listeners[] = $events->attach('dispatch', array($this, 'renderError'), -80); $this->listeners[] = $events->attach('dispatch', array($this, 'renderLayout'), -1000); }
/** * Attach one or more listeners * * @param EventCollection $events * @return ConfigListener */ public function attach(EventCollection $events) { $this->listeners[] = $events->attach('loadModule', array($this, 'loadModule'), 1000); $this->listeners[] = $events->attach('loadModules.pre', array($this, 'loadModulesPre'), 9000); $this->listeners[] = $events->attach('loadModules.post', array($this, 'loadModulesPost'), 9000); return $this; }
public function attach(EventCollection $events) { $handles = array(); $handles[] = $events->attach('foo.bar', array($this, 'fooBar')); $handles[] = $events->attach('foo.baz', array($this, 'fooBaz')); $this->handles[\spl_object_hash($events)] = $handles; return __METHOD__; }
public function attach(EventCollection $events, $priority = null) { $this->priority = $priority; $listeners = array(); $listeners[] = $events->attach('foo.bar', array($this, 'fooBar')); $listeners[] = $events->attach('foo.baz', array($this, 'fooBaz')); $this->listeners[\spl_object_hash($events)] = $listeners; return __METHOD__; }
public function attach(EventCollection $events) { $this->events = $events; $this->listeners[] = $events->attach('route', array($this, 'initRoutes'), 100); // Early listener for loading routes, late listener for injection // Place an early listener for the cached routes $this->listeners[] = $events->attach('route.init', array($this, 'loadRoutes'), 100); $this->listeners[] = $events->attach('route.init', array($this, 'insertRoutes'), -100); // Place a late listener to save the routes in cache $this->listeners[] = $events->attach('dispatch', array($this, 'loadPage'), 1000); }
/** * Attach one or more listeners * * @param EventCollection $events * @return void */ public function attach(EventCollection $events) { $options = $this->getOptions(); $configListener = $this->getConfigListener(); $moduleAutoloader = new ModuleAutoloader($options->getModulePaths()); $this->listeners[] = $events->attach('loadModules.pre', array($moduleAutoloader, 'register'), 1000); $this->listeners[] = $events->attach('loadModule.resolve', new ModuleResolverListener(), 1000); $this->listeners[] = $events->attach('loadModule', new AutoloaderListener($options), 2000); $this->listeners[] = $events->attach('loadModule', new InitTrigger($options), 1000); $this->listeners[] = $events->attachAggregate($configListener); return $this; }
public function attach(EventCollection $eventCollection) { $handles = array(); foreach ($this->eventCallbacks as $eventName => $method) { $handles[] = $eventCollection->attach($eventName, array($this, $method)); } $this->handles[\spl_object_hash($eventCollection)] = $handles; }
/** * Attach the aggregate to the specified event manager * * @param EventCollection $events * @return void */ public function attach(EventCollection $events) { $this->listeners[] = $events->attach('dispatch', array($this, 'injectParams'), 90); }
public function attach(EventCollection $events) { $events->attach('foo.bar', array($this, 'fooBar')); $events->attach('foo.baz', array($this, 'fooBaz')); }
/** * Attach the aggregate to the specified event manager * * @param EventCollection $events * @return void */ public function attach(EventCollection $events) { $this->listeners[] = $events->attach(MvcEvent::EVENT_RENDER, array($this, 'render'), -10000); }
/** * Attach listeners * * @param Events $events * @return void */ public function attach(Events $events) { $this->listeners[] = $events->attach('dispatch', array($this, 'createViewModelFromArray'), -80); }
/** * Attach one or more listeners * * @param EventCollection $events * @return void */ public function attach(EventCollection $events) { $this->listeners[] = $events->attach('loadModule', $this, 1000); $this->listeners[] = $events->attach('loadModules.post', array($this, 'mergeConfigGlobPaths'), 9000); return $this; }
/** * Attach the aggregate to the specified event manager * * @param EventCollection $events * @param int $priority * @return void */ public function attach(EventCollection $events, $priority = 1) { $this->listeners[] = $events->attach('renderer', array($this, 'selectRenderer'), $priority); $this->listeners[] = $events->attach('response', array($this, 'injectResponse'), $priority); }
/** * Attach the aggregate to the specified event manager * * @param EventCollection $events * @param int $priority * @return void */ public function attach(EventCollection $events, $priority = 1) { $this->listeners[] = $events->attach(ViewEvent::EVENT_RENDERER, array($this, 'selectRenderer'), $priority); $this->listeners[] = $events->attach(ViewEvent::EVENT_RESPONSE, array($this, 'injectResponse'), $priority); }
/** * Attach the aggregate to the specified event manager * * @param EventCollection $events * @return void */ public function attach(EventCollection $events) { $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, array($this, 'prepareExceptionViewModel')); }
/** * Attach listeners * * @param Events $events * @return void */ public function attach(Events $events) { $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'createViewModelFromArray'), -80); $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'createViewModelFromNull'), -80); }
/** * Attach listeners * * @param Events $events * @return void */ public function attach(Events $events) { $this->listeners[] = $events->attach('dispatch', array($this, 'injectViewModel'), -100); $this->listeners[] = $events->attach('dispatch.error', array($this, 'injectViewModel'), -100); }
/** * Attach the aggregate to the specified event manager * * @param EventCollection $events * @return void */ public function attach(EventCollection $events) { $this->listeners[] = $events->attach('render', array($this, 'render'), -10000); }
public function attach(EventCollection $events) { $this->listeners[] = $events->attach('dispatch', array($this, 'loadNavigation'), 100); }
/** * Attach one or more listeners * * @param EventCollection $events * @return DbIdentityResolver */ public function attach(EventCollection $events) { $this->listeners[] = $events->attach('getIdentity.resolve', array($this, 'resolveIdentity')); return $this; }
/** * Attach listeners * * @param Events $events * @return void */ public function attach(Events $events) { $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'injectViewModel'), -100); $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, array($this, 'injectViewModel'), -100); }
/** * Attach the aggregate to the specified event manager * * @param EventCollection $events * @return void */ public function attach(EventCollection $events) { $this->listeners[] = $events->attach('dispatch', array($this, 'prepareNotFoundViewModel'), -90); $this->listeners[] = $events->attach('dispatch.error', array($this, 'detectNotFoundError')); $this->listeners[] = $events->attach('dispatch.error', array($this, 'prepareNotFoundViewModel')); }
/** * Attach the aggregate to the specified event manager * * @param EventCollection $events * @return void */ public function attach(EventCollection $events) { $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'prepareNotFoundViewModel'), -90); $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, array($this, 'detectNotFoundError')); $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, array($this, 'prepareNotFoundViewModel')); }
/** * Attach listeners * * @param Events $events * @return void */ public function attach(Events $events) { $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'injectTemplate'), -90); }
/** * Attach listeners * * @param Events $events * @return void */ public function attach(Events $events) { $this->listeners[] = $events->attach('dispatch', array($this, 'injectTemplate'), -90); }
/** * Attach the aggregate to the specified event manager * * @param EventCollection $events * @return void */ public function attach(EventCollection $events) { $this->listeners[] = $events->attach('dispatch.error', array($this, 'prepareExceptionViewModel')); }