Skip to content

Commit

Permalink
feature #3436 [Reference][Form Types] Add missing docs for "action" a…
Browse files Browse the repository at this point in the history
…nd "method" option (bicpi)

This PR was merged into the 2.3 branch.

Discussion
----------

[Reference][Form Types] Add missing docs for "action" and "method" option

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

I'm not sure of adding these two options as separate rst-files because I don't think they will get listed as `inherited` options. But no other options are embedded directly. Please let me know if I can improve that.

Commits
-------

793c8a0 Add note about the PATCH method
4555495 Update note wording for "method" option
70ca6da Improvements after review
cecc762 Update "method" description
a636945 Fixes after review
83ff4b1 Improve descriptions
1bf3ce0 [Reference][Form Types] Add missing docs for "action" and "method" option
  • Loading branch information
weaverryan committed Mar 4, 2014
2 parents 3df34af + 793c8a0 commit d5d64ce
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
4 changes: 4 additions & 0 deletions reference/forms/types/form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,7 @@ on all fields.
.. include:: /reference/forms/types/options/post_max_size_message.rst.inc

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

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

.. include:: /reference/forms/types/options/method.rst.inc
12 changes: 12 additions & 0 deletions reference/forms/types/options/action.rst.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. versionadded:: 2.3
The ``action`` option was introduced in Symfony 2.3.

action
~~~~~~

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

This option specifies where to send the form's data on submission (usually an
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.
31 changes: 31 additions & 0 deletions reference/forms/types/options/method.rst.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.. versionadded:: 2.3
The ``method`` option was introduced in Symfony 2.3.

method
~~~~~~

**type**: ``string`` **default**: ``POST``

This option specifies the HTTP method used to submit the form's data. Its
value is rendered as the ``method`` attribute of the ``form`` element and is
used to decide whether to process the form submission in the
``handleRequest()`` method after submission. Possible values are:
* POST
* GET
* PUT
* DELETE
* PATCH
.. note:
When the method is PUT, PATCH, or DELETE, Symfony will automatically
render a ``_method`` hidden field in your form. This is used to "fake"
these HTTP methods, as they're not supported on standard browsers. For
more information, see :doc:`/cookbook/routing/method_parameters`.

.. 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).

0 comments on commit d5d64ce

Please sign in to comment.