8000 Merge branch '3.4' into 4.3 · dmaicher/symfony-docs@2957372 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2957372

Browse files
committed
Merge branch '3.4' into 4.3
* 3.4: Update multiple_buttons.rst
2 parents bc9f346 + 4b76812 commit 2957372

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+
// 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

Comments
 (0)
0