Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d5d64ce

Browse filesBrowse files
committed
feature #3436 [Reference][Form Types] Add missing docs for "action" and "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
2 parents 3df34af + 793c8a0 commit d5d64ce
Copy full SHA for d5d64ce

File tree

Expand file treeCollapse file tree

3 files changed

+47
-0
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+47
-0
lines changed

‎reference/forms/types/form.rst

Copy file name to clipboardExpand all lines: reference/forms/types/form.rst
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,7 @@ on all fields.
6262
.. include:: /reference/forms/types/options/post_max_size_message.rst.inc
6363

6464
.. include:: /reference/forms/types/options/pattern.rst.inc
65+
66+
.. include:: /reference/forms/types/options/action.rst.inc
67+
68+
.. include:: /reference/forms/types/options/method.rst.inc
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.. versionadded:: 2.3
2+
The ``action`` option was introduced in Symfony 2.3.
3+
4+
action
5+
~~~~~~
6+
7+
**type**: ``string`` **default**: empty string
8+
9+
This option specifies where to send the form's data on submission (usually an
10+
URI). Its value is rendered as the ``action`` attribute of the ``form``
11+
element. An empty value is considered a same-document reference, i.e. the form
12+
will be submitted to the same URI that rendered the form.
+31Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
.. versionadded:: 2.3
2+
The ``method`` option was introduced in Symfony 2.3.
3+
4+
method
5+
~~~~~~
6+
7+
**type**: ``string`` **default**: ``POST``
8+
9+
This option specifies the HTTP method used to submit the form's data. Its
10+
value is rendered as the ``method`` attribute of the ``form`` element and is
11+
used to decide whether to process the form submission in the
12+
``handleRequest()`` method after submission. Possible values are:
13+
14+
* POST
15+
* GET
16+
* PUT
17+
* DELETE
18+
* PATCH
19+
20+
.. note:
21+
22+
When the method is PUT, PATCH, or DELETE, Symfony will automatically
23+
render a ``_method`` hidden field in your form. This is used to "fake"
24+
these HTTP methods, as they're not supported on standard browsers. For
25+
more information, see :doc:`/cookbook/routing/method_parameters`.
26+
27+
.. note:
28+
29+
Only the PATCH method allows submitting partial data without that missing
30+
fields are set to ``null`` in the underlying data (preserving default
31+
values, if any).

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.