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
8da1c16c
Commit
8da1c16c
authored
Mar 05, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweak controller layout resolution.
Signed-off-by:
Taylor Otwell
<
taylorotwell@gmail.com
>
parent
2b814976
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
+18
-12
controller.php
laravel/routing/controller.php
+18
-12
No files found.
laravel/routing/controller.php
View file @
8da1c16c
...
@@ -46,6 +46,22 @@ abstract class Controller {
...
@@ -46,6 +46,22 @@ abstract class Controller {
*/
*/
const
factory
=
'laravel.controller.factory'
;
const
factory
=
'laravel.controller.factory'
;
/**
* Create a new Controller instance.
*
* @return void
*/
public
function
__construct
()
{
// If the controller has specified a layout to be used when rendering
// views, we will instantiate the layout instance and set it to the
// layout property, replacing the string layout name.
if
(
!
is_null
(
$this
->
layout
))
{
$this
->
layout
=
$this
->
layout
();
}
}
/**
/**
* Call an action method on a controller.
* Call an action method on a controller.
*
*
...
@@ -141,22 +157,12 @@ abstract class Controller {
...
@@ -141,22 +157,12 @@ abstract class Controller {
// by convention out of the bundle's controller directory.
// by convention out of the bundle's controller directory.
if
(
Event
::
listeners
(
static
::
factory
))
if
(
Event
::
listeners
(
static
::
factory
))
{
{
$controller
=
Event
::
first
(
static
::
factory
,
$controller
);
return
Event
::
first
(
static
::
factory
,
$controller
);
}
}
else
else
{
{
$controller
=
new
$controller
;
return
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
// layout property, replacing the string layout name.
if
(
!
is_null
(
$controller
->
layout
))
{
$controller
->
layout
=
$controller
->
layout
();
}
return
$controller
;
}
}
/**
/**
...
...
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