Skip to content

Commit

Permalink
minor #3630 Minor tweaks to form action/method (weaverryan)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.3 branch.

Discussion
----------

Minor tweaks to form action/method

This adds a little bit more to #3436.

The toughest part is the wording around explaining the PATCH behavior - suggestions warmly welcomed :).

| Q             | A
| ------------- | ---
| Doc fix?      | no
| New docs?     | no
| Applies to    | 2.3+
| Fixed tickets | none

Thanks!

Commits
-------

34f5b0c Some slight reordering of the form options - and also tweaking language around PATCH behavior
  • Loading branch information
weaverryan committed Mar 12, 2014
2 parents ae755e0 + 34f5b0c commit f6a41b9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
12 changes: 6 additions & 6 deletions reference/forms/types/form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ See :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\FormType`.
The ``form`` type predefines a couple of options that are then available
on all fields.

.. include:: /reference/forms/types/options/compound.rst.inc

.. include:: /reference/forms/types/options/data.rst.inc

.. include:: /reference/forms/types/options/data_class.rst.inc

.. include:: /reference/forms/types/options/action.rst.inc

.. include:: /reference/forms/types/options/method.rst.inc

.. include:: /reference/forms/types/options/empty_data.rst.inc

.. include:: /reference/forms/types/options/compound.rst.inc

.. _reference-form-option-required:

.. include:: /reference/forms/types/options/required.rst.inc
Expand Down Expand Up @@ -68,7 +72,3 @@ on all fields.
.. _reference-form-option-pattern:

.. include:: /reference/forms/types/options/pattern.rst.inc

.. include:: /reference/forms/types/options/action.rst.inc

.. include:: /reference/forms/types/options/method.rst.inc
2 changes: 1 addition & 1 deletion reference/forms/types/options/action.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ action

**type**: ``string`` **default**: empty string

This option specifies where to send the form's data on submission (usually an
This option specifies where to send the form's data on submission (usually a
URI). Its value is rendered as the ``action`` attribute of the ``form``
element. An empty value is considered a same-document reference, i.e. the form
will be submitted to the same URI that rendered the form.
8 changes: 5 additions & 3 deletions reference/forms/types/options/method.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ used to decide whether to process the form submission in the

.. note:

Only the PATCH method allows submitting partial data without that missing
fields are set to ``null`` in the underlying data (preserving default
values, if any).
The PATCH method allows submitting partial data. In other words, if the
submitted form data is missing certain fields, those will be ignored
and the default values (if any) will be used. With all other HTTP methods,
if the submitted form data is missing some fields, those fields are set
to ``null``.

0 comments on commit f6a41b9

Please sign in to comment.