Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
Overview
Overview
Details
Activity
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
Commits
dfe3a046
Commit
dfe3a046
authored
Sep 30, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added support for route filter parameters.
parent
21592ec6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
laravel/routing/caller.php
+11
-1
laravel/routing/route.php
+3
-1
No files found.
laravel/routing/caller.php
View file @
dfe3a046
...
@@ -134,7 +134,7 @@ class Caller {
...
@@ -134,7 +134,7 @@ class Caller {
// an underscore are not publicly available.
// an underscore are not publicly available.
if
(
is_null
(
$controller
)
or
(
$method
==
'before'
or
strncmp
(
$method
,
'_'
,
1
)
===
0
))
if
(
is_null
(
$controller
)
or
(
$method
==
'before'
or
strncmp
(
$method
,
'_'
,
1
)
===
0
))
{
{
return
$this
->
container
->
resolve
(
'laravel.response'
)
->
error
(
'404'
);
return
Response
::
error
(
'404'
);
}
}
$controller
->
container
=
$this
->
container
;
$controller
->
container
=
$this
->
container
;
...
@@ -222,6 +222,16 @@ class Caller {
...
@@ -222,6 +222,16 @@ class Caller {
{
{
foreach
((
array
)
$filters
as
$filter
)
foreach
((
array
)
$filters
as
$filter
)
{
{
// Parameters may be passed into routes by specifying the list of parameters after
// a colon. If parameters are present, we will merge them into the parameter array
// that was passed to the method and slice the parameters off of the filter string.
if
((
$colon
=
strpos
(
$filter
,
':'
))
!==
false
)
{
$parameters
=
array_merge
(
$parameters
,
explode
(
','
,
substr
(
$filter
,
$colon
+
1
)));
$filter
=
substr
(
$filter
,
0
,
$colon
);
}
if
(
!
isset
(
$this
->
filters
[
$filter
]))
continue
;
if
(
!
isset
(
$this
->
filters
[
$filter
]))
continue
;
$response
=
call_user_func_array
(
$this
->
filters
[
$filter
],
$parameters
);
$response
=
call_user_func_array
(
$this
->
filters
[
$filter
],
$parameters
);
...
...
laravel/routing/route.php
View file @
dfe3a046
...
@@ -126,7 +126,9 @@ class Route {
...
@@ -126,7 +126,9 @@ class Route {
{
{
if
(
is_array
(
$this
->
callback
)
and
isset
(
$this
->
callback
[
$name
]))
if
(
is_array
(
$this
->
callback
)
and
isset
(
$this
->
callback
[
$name
]))
{
{
return
explode
(
', '
,
$this
->
callback
[
$name
]);
$filters
=
$this
->
callback
[
$name
];
return
(
is_string
(
$filters
))
?
explode
(
'|'
,
$filters
)
:
$filters
;
}
}
return
array
();
return
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