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
21a51b7c
Commit
21a51b7c
authored
May 10, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add controller and controller_action to route.
parent
641f1d4c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
6 deletions
+26
-6
laravel/routing/controller.php
+12
-6
laravel/routing/route.php
+14
-0
No files found.
laravel/routing/controller.php
View file @
21a51b7c
...
...
@@ -154,13 +154,19 @@ abstract class Controller {
// improve speed since the bundle is not loaded on every request.
Bundle
::
start
(
$bundle
);
list
(
$
controller_
name
,
$method
)
=
explode
(
'@'
,
$destination
);
list
(
$name
,
$method
)
=
explode
(
'@'
,
$destination
);
$controller
=
static
::
resolve
(
$bundle
,
$controller_name
);
$controller
->
bundle
=
$bundle
;
$controller
->
name
=
$controller_name
;
$controller
->
action
=
$method
;
$controller
=
static
::
resolve
(
$bundle
,
$name
);
// For convenience we will set the current controller and action on the
// Request's route instance so they can be easily accessed from the
// application. This is sometimes useful for dynamic situations.
if
(
!
is_null
(
$route
=
Request
::
route
()))
{
$route
->
controller
=
$name
;
$route
->
controller_action
=
$method
;
}
// If the controller could not be resolved, we're out of options and
// will return the 404 error response. If we found the controller,
...
...
laravel/routing/route.php
View file @
21a51b7c
...
...
@@ -31,6 +31,20 @@ class Route {
public
$bundle
;
/**
* The name of the controller used by the route.
*
* @var string
*/
public
$controller
;
/**
* The name of the controller action used by the route.
*
* @var string
*/
public
$controller_action
;
/**
* The action that is assigned to the route.
*
* @var mixed
...
...
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