Commit 28e87dac authored by Fabien Potencier's avatar Fabien Potencier

merged branch igorw/put-delete-example (PR #629)

This PR was merged into the master branch.

Commits
-------

e055ed3e [docs] Add code examples for PUT and DELETE routes

Discussion
----------

[docs] Add code examples for PUT and DELETE routes
parents 34e3e75b e055ed3e
......@@ -220,22 +220,28 @@ Other methods
~~~~~~~~~~~~~
You can create controllers for most HTTP methods. Just call one of these
methods on your application: ``get``, ``post``, ``put``, ``delete``. You can
also call ``match``, which will match all methods::
methods on your application: ``get``, ``post``, ``put``, ``delete``::
$app->match('/blog', function () {
$app->put('/blog/{id}', function ($id) {
...
});
You can then restrict the allowed methods via the ``method`` method::
$app->delete('/blog/{id}', function ($id) {
...
});
You can also call ``match``, which will match all methods. This can be
restricted via the ``method`` method::
$app->match('/blog', function () {
...
});
$app->match('/blog', function () {
...
})
->method('PATCH');
You can match multiple methods with one controller using regex syntax::
$app->match('/blog', function () {
...
})
......
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