-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
The event POST_SUBMIT (and potentially PRE_SUBMIT, PRE_SET_DATA and POST_SET_DATA) should be supported on buttons. Using this event, dynamic functionality can be built into forms that depends on whether a button was clicked or not:
$builder->get('refresh')->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) {
$refresh = $event->getForm();
$form = $refresh->getParent();
if ($refresh->isClicked()) {
// do something with $form
}
});
May be related to #5807.
mataslib and sukei