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
{{ message }}
This repository has been archived by the owner on Feb 7, 2021. It is now read-only.
Eric Richer edited this page Jul 10, 2020
·
1 revision
Task
Modify the form objects used by LmcUser 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 shared event manager and attach a listener.
<?phppublicfunctiononBootstrap($e)
{
$events = $e->getApplication()->getEventManager()->getSharedManager();
$events->attach('LmcUser\Form\Register','init', function($e) {
$form = $e->getTarget();
// Do what you please with the form instance ($form)
});
$events->attach('LmcUser\Form\RegisterFilter','init', function($e) {
$filter = $e->getTarget();
// Do what you please with the filter instance ($filter)
});
}
TODO: Illustrate a method that doesn't use StaticEventManager