You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
adamlundrigan edited this page Jun 6, 2012
·
4 revisions
Task
Modify the form objects used by ZfcUser for registration and/or login.
Solution
You can accomplish this by hooking into the init event of the form you wish to modify. The simplest way to do this is pull the static event manager and attach a listener.
$events = \Zend\EventManager\StaticEventManager::getInstance();
$events->attach('ZfcUser\Form\Register','init', function($e) {
$form = $e->getTarget();
// Do what you please with the form instance ($form)
});
TODO: Illustrate a method that doesn't use StaticEventManager