Skip to content

Instantly share code, notes, and snippets.

@microlancer
Created October 3, 2012 18:37
Show Gist options
  • Select an option

  • Save microlancer/3828893 to your computer and use it in GitHub Desktop.

Select an option

Save microlancer/3828893 to your computer and use it in GitHub Desktop.
Why isn't this event triggered?
class Module
{
public function onBootstrap($e)
{
$moduleManager = $e->getApplication()->getServiceManager()->get('modulemanager');
$sharedEvents = $moduleManager->getEventManager()->getSharedManager();
$sharedEvents->attach('Zend\Mvc\Controller\AbstractRestfulController', MvcEvent::EVENT_DISPATCH, array($this, 'mvcPreDispatch'), -100);
}
public function mvcPreDispatch($event)
{
echo "Do this..."; die;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment