Skip to content

Commit b76bcff

Browse files
authored
Update multiple_buttons.rst
1 parent 40505d0 commit b76bcff

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

form/multiple_buttons.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +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')){
42+
43+
}

0 commit comments

Comments
 (0)