Skip to content

Instantly share code, notes, and snippets.

@gabriel403
Created July 3, 2013 19:49
Show Gist options
  • Save gabriel403/5922136 to your computer and use it in GitHub Desktop.
Save gabriel403/5922136 to your computer and use it in GitHub Desktop.
Returning json error to an xhr request
$sharedEvents = $e->getTarget()->getServiceManager()->get('SharedEventManager');
$sharedEvents->attach('Zend\Mvc\Application', 'dispatch.error', function ($event){
//do magic
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment