Commit 72e1acc3 authored by Fabien Potencier's avatar Fabien Potencier

merged branch mathiasverraes/patch-1 (PR #201)

Commits
-------

81576415 Matching multiple methods with one controller, see http://groups.google.com/group/silex-php/browse_thread/thread/5f3b3d791c337845

Discussion
----------

Matching multiple methods with one controller, see http://groups.google.c

Matching multiple methods with one controller, see http://groups.google.com/group/silex-php/browse_thread/thread/5f3b3d791c337845
parents bcb367ed 81576415
...@@ -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