Commit e055ed3e authored by Igor Wiedler's avatar Igor Wiedler

[docs] Add code examples for PUT and DELETE routes

parent c2ac686e
...@@ -220,22 +220,28 @@ Other methods ...@@ -220,22 +220,28 @@ Other methods
~~~~~~~~~~~~~ ~~~~~~~~~~~~~
You can create controllers for most HTTP methods. Just call one of these You can create controllers for most HTTP methods. Just call one of these
methods on your application: ``get``, ``post``, ``put``, ``delete``. You can methods on your application: ``get``, ``post``, ``put``, ``delete``::
also call ``match``, which will match all methods::
$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 () { $app->match('/blog', function () {
... ...
}) })
->method('PATCH'); ->method('PATCH');
You can match multiple methods with one controller using regex syntax::
$app->match('/blog', function () { $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