Skip to content

Commit 9417432

Browse files
Added alternative syntax using getClickedButton()
1 parent 9671b95 commit 9417432

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

form/multiple_buttons.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,10 @@ querying if the "Save and add" button was clicked::
3131

3232
return $this->redirectToRoute($nextAction);
3333
}
34+
35+
Or you can get the button's name by using the
36+
:method:`Symfony\\Component\\Form\\Form::getClickedButton` method of the form::
37+
38+
if ($form->getClickedButton()->getName()==='saveAndAdd')
39+
40+

0 commit comments

Comments
 (0)