We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f16530b + 41a75eb commit 2b43b9fCopy full SHA for 2b43b9f
form/multiple_buttons.rst
@@ -35,3 +35,9 @@ Or you can get the button's name by using the
35
if ($form->getClickedButton() && 'saveAndAdd' === $form->getClickedButton()->getName()) {
36
// ...
37
}
38
+
39
+ // when using nested forms, two or more buttons can have the same name;
40
+ // in those cases, compare the button objects instead of the button names
41
+ if ($form->getClickedButton() === $form->get('saveAndAdd')){
42
+ // ...
43
+ }
0 commit comments