Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
d29a1279
Commit
d29a1279
authored
Feb 23, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow multiple request methods for uri.
parent
f624a684
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
2 deletions
+21
-2
router.php
laravel/routing/router.php
+21
-2
No files found.
laravel/routing/router.php
View file @
d29a1279
...
@@ -39,7 +39,13 @@ class Router {
...
@@ -39,7 +39,13 @@ class Router {
*
*
* @var array
* @var array
*/
*/
public
static
$fallback
=
array
();
public
static
$fallback
=
array
(
'GET'
=>
array
(),
'POST'
=>
array
(),
'PUT'
=>
array
(),
'DELETE'
=>
array
(),
'HEAD'
=>
array
(),
);
/**
/**
* The current attributes being shared by routes.
* The current attributes being shared by routes.
...
@@ -87,7 +93,7 @@ class Router {
...
@@ -87,7 +93,7 @@ class Router {
*
*
* @var array
* @var array
*/
*/
public
static
$methods
=
array
(
'GET'
,
'POST'
,
'PUT'
,
'DELETE'
);
public
static
$methods
=
array
(
'GET'
,
'POST'
,
'PUT'
,
'DELETE'
,
'HEAD'
);
/**
/**
* Register a HTTPS route with the router.
* Register a HTTPS route with the router.
...
@@ -168,6 +174,19 @@ class Router {
...
@@ -168,6 +174,19 @@ class Router {
{
{
if
(
is_string
(
$route
))
$route
=
explode
(
', '
,
$route
);
if
(
is_string
(
$route
))
$route
=
explode
(
', '
,
$route
);
// If the developer is registering multiple request methods to handle
// the URI, we'll spin through each method and register the route
// for each of them along with each URI.
if
(
is_array
(
$method
))
{
foreach
(
$method
as
$http
)
{
static
::
register
(
$http
,
$route
,
$action
);
}
return
;
}
foreach
((
array
)
$route
as
$uri
)
foreach
((
array
)
$route
as
$uri
)
{
{
// If the URI begins with a splat, we'll call the universal method, which
// If the URI begins with a splat, we'll call the universal method, which
...
...
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