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
e70261e9
Commit
e70261e9
authored
Feb 22, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added support for controller factories.
parent
86fa5953
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
laravel/event.php
+1
-1
laravel/routing/controller.php
+16
-2
No files found.
laravel/event.php
View file @
e70261e9
...
...
@@ -83,7 +83,7 @@ class Event {
{
foreach
(
static
::
$events
[
$event
]
as
$callback
)
{
$responses
[]
=
call_user_func_array
(
$callback
,
$parameters
);
$responses
[]
=
call_user_func_array
(
$callback
,
(
array
)
$parameters
);
}
}
...
...
laravel/routing/controller.php
View file @
e70261e9
...
...
@@ -40,6 +40,13 @@ abstract class Controller {
protected
$filters
=
array
();
/**
* The event name for the Laravel controller factory.
*
* @var string
*/
const
factory
=
'laravel.controller.factory'
;
/**
* Call an action method on a controller.
*
* <code>
...
...
@@ -127,12 +134,19 @@ abstract class Controller {
return
IoC
::
resolve
(
$resolver
);
}
$controller
=
static
::
format
(
$bundle
,
$controller
);
// If we couldn't resolve the controller out of the IoC container we'll
// format the controller name into its proper class name and load it
// by convention out of the bundle's controller directory.
$controller
=
static
::
format
(
$bundle
,
$controller
);
if
(
Event
::
listeners
(
static
::
factory
))
{
$controller
=
Event
::
first
(
static
::
factory
,
$controller
);
}
else
{
$controller
=
new
$controller
;
}
// If the controller has specified a layout to be used when rendering
// views, we will instantiate the layout instance and set it to the
...
...
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