Commit 94d9da5a authored by Fabien Potencier's avatar Fabien Potencier

merged branch robdudley/master (PR #636)

This PR was squashed before being merged into the master branch (closes #636).

Commits
-------

abdc1fc7 Updated docs to include _method and enableHttpMethodParameterOverride()

Discussion
----------

Updated docs to include _method and enableHttpMethodParameterOverride()

Should be self explanatory. Small addition to the docs to explain about the _method form value and also to advise abut the explicit enableHttpMethodParameterOverride() call required with Symfony 2.2.0 and later.

---------------------------------------------------------------------------

by igorw at 2013-02-18T13:57:37Z

Please wrap the docs at 80 chars.

👍

---------------------------------------------------------------------------

by davedevelopment at 2013-02-18T14:02:08Z

👍

Only one thing, do we need to explicitly state to do this before the request is handled? No-brainer to us, but what about others?

Or should I say, how likely are people to try and do something like:

``` php

$app->put("/some/resource", function(Request $request) {
    Request::enableHttpMethodParameterOverride();
});

```

---------------------------------------------------------------------------

by robdudley at 2013-02-18T14:11:15Z

I've used a similar example to the reverse proxy tip which I hope would make the context clear. Not sure how else to word it without becoming unnecessarily verbose. Also I'm assuming that the setting is going to be rolled into core at some point as it has pretty big backwards compatibility implications.

---------------------------------------------------------------------------

by davedevelopment at 2013-02-18T14:14:00Z

:shipit:
parents 44183a2c abdc1fc7
...@@ -230,6 +230,28 @@ methods on your application: ``get``, ``post``, ``put``, ``delete``:: ...@@ -230,6 +230,28 @@ methods on your application: ``get``, ``post``, ``put``, ``delete``::
... ...
}); });
.. tip::
Forms in most web browsers do not directly support the use of other HTTP
methods. To use methods other than GET and POST you can utilize a special
form field with a name of ``_method``. The form's ``method`` attribute must
be set to POST when using this field::
<form action="/my/target/route/" method="post">
...
<input type="hidden" id="_method" name="_method" value="PUT" />
</form>
.. note::
If using Symfony Components >= 2.2.0 you will need to explicitly enable this
method override::
use Symfony\Component\HttpFoundation\Request;
Request::enableHttpMethodParameterOverride();
$app->run();
You can also call ``match``, which will match all methods. This can be You can also call ``match``, which will match all methods. This can be
restricted via the ``method`` method:: restricted via the ``method`` method::
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment