Skip to content

Instantly share code, notes, and snippets.

@basz
Created May 30, 2012 10:23
Show Gist options
  • Select an option

  • Save basz/2835347 to your computer and use it in GitHub Desktop.

Select an option

Save basz/2835347 to your computer and use it in GitHub Desktop.
class Module
{
public function init(Manager $moduleManager)
{
$this->sharedEvents = $moduleManager->events()->getSharedManager();
$this->sharedEvents->attach('bootstrap', 'bootstrap', array($this, 'boostrapHandler'), 100);
}
public function boostrapHandler($e)
{
$this->sharedEvents->attach('Zend\Mvc\Controller\ActionController', 'prepare.package', function($e) use ($locator) {
$service = $locator->get('Application\Service\StoreService');
return $service->preparePackage($e);
}, 100);
}
}
where StoreService has an simple DI presence like :
'Application\Service\StoreService' => array(
),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment