Skip to content

Commit 4b76812

Browse files
committed
Minor reword
1 parent 0d937db commit 4b76812

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

form/multiple_buttons.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ Or you can get the button's name by using the
3535
if ($form->getClickedButton() && 'saveAndAdd' === $form->getClickedButton()->getName()) {
3636
// ...
3737
}
38-
39-
If you have multiple buttons with the same name, each nested in multiple subforms, use direct reference instead the name to get the right button
40-
41-
if ($form->getClickedButton() && $form->getClickedButton() === $form->get('saveAndAdd')){
4238

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+
// ...
4343
}

0 commit comments

Comments
 (0)