<snip>
        public function init(ModuleManager $moduleManager)
        {
                $events = $moduleManager->events();
                $sharedEvents = $events->getSharedManager();
                $sharedEvents->attach('application', 'bootstrap', array($this,
'initializeSmarty') , 10010);

                $serviceManager = 
$moduleManager->getEvent()->getParam('ServiceManager');
                $sharedEvents->detach('application', 
$serviceManager->get('ViewManager'));
</snip>

causes:

Catchable fatal error: Argument 2 passed to
Zend\EventManager\SharedEventManager::detach() must be an instance of
Zend\Stdlib\CallbackHandler, instance of Zend\Mvc\View\ViewManager given

see:
SharedEventManager / SharedEventManagerInterface:

public function detach($id, CallbackHandler $listener)

if I remove the depandancy everything works fine, is it needed anywhere or
is it an bug. I haven't seen any usages of the CallbackHandler.

-----
Hasan H. Gürsoy (HHGAG)
--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/zf2-detach-event-in-Module-init-tp4646688.html
Sent from the Zend Framework mailing list archive at Nabble.com.

--
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to