8000
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 bc9f346 + 4b76812 commit 2957372Copy full SHA for 2957372
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