Commit 81576415 authored by Mathias Verraes's avatar Mathias Verraes

Matching multiple methods with one controller, see...

Matching multiple methods with one controller, see http://groups.google.com/group/silex-php/browse_thread/thread/5f3b3d791c337845
parent bcb367ed
...@@ -195,11 +195,19 @@ You can then restrict the allowed methods via the ``method`` method:: ...@@ -195,11 +195,19 @@ You can then restrict the allowed methods via the ``method`` method::
}) })
->method('PATCH'); ->method('PATCH');
You can match multiple methods with one controller using regex syntax::
$app->match('/blog', function () {
...
})
->method('PUT|POST');
.. note:: .. note::
The order in which the routes are defined is significant. The first The order in which the routes are defined is significant. The first
matching route will be used, so place more generic routes at the bottom. matching route will be used, so place more generic routes at the bottom.
Route variables Route variables
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
......
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