Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitd5d64ce

Browse files
committed
featuresymfony#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 |symfony#3410I'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 method4555495 Update note wording for "method" option70ca6da Improvements after reviewcecc762 Update "method" descriptiona636945 Fixes after review83ff4b1 Improve descriptions1bf3ce0 [Reference][Form Types] Add missing docs for "action" and "method" option
2 parents3df34af +793c8a0 commitd5d64ce

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

‎reference/forms/types/form.rst

Lines 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
Lines 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 introducedin Symfony2.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.
Lines 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 introducedin Symfony2.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 underlyingdata (preserving default
31+
values,if any).

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp