Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Form] Updated direct submit article #7707

Merged
merged 3 commits into from
Apr 8, 2017
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions form/direct_submit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ submissions::
Calling Form::submit() manually
-------------------------------

.. versionadded:: 2.3
Before Symfony 2.3, the ``submit()`` method was known as ``bind()``.

In some cases, you want better control over when exactly your form is submitted
and what data is passed to it. Instead of using the
:method:`Symfony\\Component\\Form\\FormInterface::handleRequest`
Expand Down Expand Up @@ -88,9 +85,16 @@ method, pass the submitted data directly to

When submitting a form via a "PATCH" request, you may want to update only a few
submitted fields. To achieve this, you may pass an optional second boolean
parameter to ``submit()``. Passing ``false`` will remove any missing fields
argument to ``submit()``. Passing ``false`` will remove any missing fields
within the form object. Otherwise, the missing fields will be set to ``null``.

.. caution::

When the second parameter ``$clearMissing`` is ``false``, like with "PATCH"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[...] with the "PATCH" method [...]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

method, the validation extension will only handle the submitted fields. If
the underlying data needs to be validated, this should be done manually,
i.e using the validator.

.. _form-submit-request:

Passing a Request to Form::submit() (Deprecated)
Expand Down Expand Up @@ -129,5 +133,5 @@ a convenient shortcut to the previous example::

Passing the :class:`Symfony\\Component\\HttpFoundation\\Request` directly to
:method:`Symfony\\Component\\Form\\FormInterface::submit` still works, but is
deprecated and will be removed in Symfony 3.0. You should use the method
deprecated and has been removed in Symfony 3.0. You should use the method
:method:`Symfony\\Component\\Form\\FormInterface::handleRequest` instead.