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
b353afdc
Commit
b353afdc
authored
Feb 13, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing router bugs.
parent
0438c696
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
3 deletions
+30
-3
router.php
laravel/routing/router.php
+30
-3
No files found.
laravel/routing/router.php
View file @
b353afdc
...
...
@@ -423,7 +423,7 @@ class Router {
{
Bundle
::
start
(
$bundle
=
Bundle
::
handles
(
$uri
));
$routes
=
(
array
)
static
::
routes
(
$method
);
$routes
=
(
array
)
static
::
method
(
$method
);
// Of course literal route matches are the quickest to find, so we will
// check for those first. If the destination key exists in the routes
...
...
@@ -453,7 +453,7 @@ class Router {
*/
protected
static
function
match
(
$method
,
$uri
)
{
foreach
(
static
::
routes
(
$method
)
as
$route
=>
$action
)
foreach
(
static
::
method
(
$method
)
as
$route
=>
$action
)
{
// We only need to check routes with regular expression since all other
// would have been able to be matched by the search for literal matches
...
...
@@ -499,10 +499,37 @@ class Router {
/**
* Get all of the registered routes, with fallbacks at the end.
*
* @return array
*/
public
static
function
routes
()
{
$routes
=
static
::
$routes
;
foreach
(
static
::
$methods
as
$method
)
{
// It's possible that the routes array may not contain any routes for the
// method, so we'll seed each request method with an empty array if it
// doesn't already contain any routes.
if
(
!
isset
(
$routes
[
$method
]))
$routes
[
$method
]
=
array
();
$fallback
=
array_get
(
static
::
$fallback
,
$method
,
array
());
// When building the array of routes, we'll merge in all of the fallback
// routes for each request methdo individually. This allows us to avoid
// collisions when merging the arrays together.
$routes
[
$method
]
=
array_merge
(
$routes
[
$method
],
$fallback
);
}
return
$routes
;
}
/**
* Grab all of the routes for a given request method.
*
* @param string $method
* @return array
*/
public
static
function
routes
(
$method
=
null
)
public
static
function
method
(
$method
)
{
$routes
=
array_get
(
static
::
$routes
,
$method
,
array
());
...
...
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