Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
e055ed3e
Commit
e055ed3e
authored
Feb 11, 2013
by
Igor Wiedler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[docs] Add code examples for PUT and DELETE routes
parent
c2ac686e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
doc/usage.rst
doc/usage.rst
+12
-6
No files found.
doc/usage.rst
View file @
e055ed3e
...
@@ -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 () {
...
...
})
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment