Skip to content

Commit d80dbb4

Browse files
committed
Improve the Best Practice about forms with multiple buttons
1 parent 4533004 commit d80dbb4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

best_practices.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,10 @@ to add buttons in the templates. This also improves the separation of concerns,
299299
because the button styling (CSS class and other attributes) is defined in the
300300
template instead of in a PHP class.
301301

302+
However, if you create a :doc:`form with multiple submit buttons </form/multiple_buttons>`
303+
you should define them in the controller instead of the template. Otherwise, you
304+
won't be able to check which button was clicked when handling the form in the controller.
305+
302306
Define Validation Constraints on the Underlying Object
303307
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
304308

0 commit comments

Comments
 (0)