zend framework - ZF3: SharedEventManager injection in EventManager for ZfcUser -
i'm trying modify form of zfcuser , found explanation:
https://github.com/zf-commons/zfcuser/wiki/how-to-modify-the-form-objects-used-by-zfcuser
however it's not working expected. after debugging last night found 1 side leads me attach method of sharedeventmanager:
https://github.com/zendframework/zend-eventmanager/blob/master/src/sharedeventmanager.php#l61
and other side execute trigger out of zfcuser login form, lead me eventmanager:
https://github.com/zendframework/zend-eventmanager/blob/master/src/eventmanager.php#l75
i modified code debugging this:
error_log('check sharedeventmanager'); if ($sharedeventmanager) { error_log('sharedeventmanager there'); $this->sharedmanager = $sharedeventmanager; $this->setidentifiers($identifiers); }
i added debugging before , after trigger out of zfcuser\form\login: https://github.com/zf-commons/zfcuser/blob/3.x/src/zfcuser/form/login.php#l70
error_log('before zend login form trigger: '.get_class($this)); $this->geteventmanager()->trigger('init', $this); error_log('after zend login form trigger');
the docs sharedeventmanager gets injected eventmanager (https://framework.zend.com/manual/2.4/en/modules/zend.event-manager.event-manager.html), looks that's not heppening. it's 2.4 docs changelog says: eventmanagerinterface::setsharedmanager() removed. shared managers expected injected during instantiation. (https://github.com/zendframework/zend-eventmanager/blob/master/changelog.md)
so sharedeventmanager should injected? see geteventmanager method in https://github.com/zf-commons/zfcuser/blob/3.x/src/zfcuser/eventmanager/eventprovider.php#l47. simple created new eventmanager new sharedeventmanager.
from here not able find instanciated , sharedeventmanager should injected zfcusers eventmanager. can point out how sharedeventmanager active in zfcuser?
cheers andi
Comments
Post a Comment