Created
June 5, 2013 00:59
-
-
Save eminetto/5710879 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Executada no bootstrap do módulo | |
* | |
* @param MvcEvent $e | |
*/ | |
public function onBootstrap($e) | |
{ | |
/** @var \Zend\ModuleManager\ModuleManager $moduleManager */ | |
$moduleManager = $e->getApplication()->getServiceManager()->get('modulemanager'); | |
/** @var \Zend\EventManager\SharedEventManager $sharedEvents */ | |
$sharedEvents = $moduleManager->getEventManager()->getSharedManager(); | |
//adiciona eventos ao módulo | |
//pré e pós-processadores do controller Rest | |
$sharedEvents->attach('Api\Controller\RestController', MvcEvent::EVENT_DISPATCH, array(new PostProcessor, 'process'), -100); | |
$sharedEvents->attach('Api\Controller\RestController', MvcEvent::EVENT_DISPATCH, array(new PreProcessor, 'process'), 100); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment