Skip to content

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

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

Merged
merged 7 commits into from
Mar 4, 2014
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions reference/forms/types/form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@ on all fields.

.. include:: /reference/forms/types/options/invalid_message_parameters.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
Copy link
Member

Choose a reason for hiding this comment

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

I think there's a to missing at the end of the sentence ([...] where to send [...] to.).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mh, maybe both is possible? Is some native speaker around?

Copy link
Member

Choose a reason for hiding this comment

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

I'm not native, but I also agree with @bicpi: imo both are possible.

Copy link
Member

Choose a reason for hiding this comment

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

agreed, I think without the to sounds a little better. So, keep it as is

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