Skip to content
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

Change _method parameter versionadded note #6735

Merged
merged 2 commits into from
Jul 9, 2016
Merged
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
13 changes: 5 additions & 8 deletions cookbook/routing/method_parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,6 @@ delete it by matching on GET, PUT and DELETE.
Faking the Method with ``_method``
----------------------------------

.. note::

The ``_method`` functionality shown here is disabled by default in Symfony 2.2
and enabled by default in Symfony 2.3. To control it in Symfony 2.2, you
must call :method:`Request::enableHttpMethodParameterOverride <Symfony\\Component\\HttpFoundation\\Request::enableHttpMethodParameterOverride>`
before you handle the request (e.g. in your front controller). In Symfony
2.3, use the :ref:`configuration-framework-http_method_override` option.

Unfortunately, life isn't quite this simple, since most browsers do not support
sending PUT and DELETE requests via the `method` attribute in an HTML form. Fortunately,
Symfony provides you with a simple way of working around this limitation. By including
Expand All @@ -90,3 +82,8 @@ will use this as the method when matching routes. Forms automatically include a
hidden field for this parameter if their submission method is not GET or POST.
See :ref:`the related chapter in the forms documentation<book-forms-changing-action-and-method>`
for more information.

.. tip::

You can disable the ``_method`` functionality shown here using the
:ref:`configuration-framework-http_method_override` option.