Skip to content

Commit e4ec7bd

Browse files
paulferrettxabbuh
authored andcommitted
Update form best practises regarding Form::isValid
1 parent 386156b commit e4ec7bd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

best_practices/forms.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ and a ``createAction()`` that *only* processes the form submit. Both those
204204
actions will be almost identical. So it's much simpler to let ``newAction()``
205205
handle everything.
206206

207-
Second, we recommend using ``$form->isSubmitted()`` in the ``if`` statement
208-
for clarity. This isn't technically needed, since ``isValid()`` first calls
209-
``isSubmitted()``. But without this, the flow doesn't read well as it *looks*
210-
like the form is *always* processed (even on the GET request).
207+
Second, is it required to call ``$form->isSubmitted()`` in the ``if`` statement
208+
before calling ``isValid()``. Calling ``isValid()`` with an unsubmitted form
209+
is deprecated since version 3.2 and will throw an exception in 4.0.

0 commit comments

Comments
 (0)