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
3d6daa4c
Commit
3d6daa4c
authored
Dec 28, 2010
by
Igor Wiedler
Committed by
Fabien Potencier
Dec 30, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow all HTTP verbs if not specified, adjust documentation
parent
2ffd9d14
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
README.md
README.md
+3
-3
silex.phar
silex.phar
+0
-0
src/Silex/Framework.php
src/Silex/Framework.php
+3
-2
No files found.
README.md
View file @
3d6daa4c
...
...
@@ -9,17 +9,17 @@ Silex is a simple web framework to develop simple websites:
use Silex\Framework;
$framework = new Framework(array(
'
GET
/hello/:name' => function($name)
'/hello/:name' => function($name)
{
return new Response('Hello '.$name);
},
'POST /goodbye/:name' => function($name)
'
GET|PUT|
POST /goodbye/:name' => function($name)
{
return new Response('Goodbye '.$name);
},
));
$framework->
handle()->send
();
$framework->
run
();
Silex is based on
[
Symfony2
][
1
]
.
...
...
silex.phar
View file @
3d6daa4c
No preview for this file type
src/Silex/Framework.php
View file @
3d6daa4c
...
...
@@ -35,11 +35,12 @@ class Framework extends BaseHttpKernel
foreach
(
$map
as
$pattern
=>
$to
)
{
if
(
false
!==
strpos
(
$pattern
,
' '
))
{
list
(
$method
,
$pattern
)
=
explode
(
' '
,
$pattern
,
2
);
$method
=
explode
(
'|'
,
$method
);
}
else
{
$method
=
'GET'
;
$method
=
array
()
;
}
$route
=
new
Route
(
$pattern
,
array
(
'_controller'
=>
$to
),
array
(
'_method'
=>
explode
(
'|'
,
$method
)
));
$route
=
new
Route
(
$pattern
,
array
(
'_controller'
=>
$to
),
array
(
'_method'
=>
$method
));
$this
->
routes
->
addRoute
(
str_replace
(
array
(
'/'
,
':'
),
'_'
,
$pattern
),
$route
);
}
...
...
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