diff --git a/reference/forms/types/form.rst b/reference/forms/types/form.rst index dfe67119f6c..14200097904 100644 --- a/reference/forms/types/form.rst +++ b/reference/forms/types/form.rst @@ -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 diff --git a/reference/forms/types/options/action.rst.inc b/reference/forms/types/options/action.rst.inc new file mode 100644 index 00000000000..70977722000 --- /dev/null +++ b/reference/forms/types/options/action.rst.inc @@ -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. diff --git a/reference/forms/types/options/method.rst.inc b/reference/forms/types/options/method.rst.inc new file mode 100644 index 00000000000..d1d6c84b1ce --- /dev/null +++ b/reference/forms/types/options/method.rst.inc @@ -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).