Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
b9a30b30
Commit
b9a30b30
authored
Apr 10, 2012
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better naming for loadIfNot argument of Module::getModule and Module::getComponent
parent
e585c69f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
Module.php
framework/base/Module.php
+7
-7
No files found.
framework/base/Module.php
View file @
b9a30b30
...
...
@@ -201,17 +201,17 @@ abstract class Module extends Component implements Initable
/**
* Retrieves the named module.
* @param string $id module ID (case-sensitive)
* @param boolean $load
IfNot whether to load the module if it is not yet
.
* @param boolean $load
whether to load the module if it is not yet loaded
.
* @return Module|null the module instance, null if the module
* does not exist.
* @see hasModule()
*/
public
function
getModule
(
$id
,
$load
IfNot
=
true
)
public
function
getModule
(
$id
,
$load
=
true
)
{
if
(
isset
(
$this
->
_modules
[
$id
]))
{
if
(
$this
->
_modules
[
$id
]
instanceof
Module
)
{
return
$this
->
_modules
[
$id
];
}
elseif
(
$load
IfNot
)
{
}
elseif
(
$load
)
{
\Yii
::
trace
(
"Loading
\"
$id
\"
module"
,
__CLASS__
);
return
$this
->
_modules
[
$id
]
=
\Yii
::
createObject
(
$this
->
_modules
[
$id
],
$id
,
$this
);
}
...
...
@@ -293,7 +293,7 @@ abstract class Module extends Component implements Initable
$this
->
_modules
[
$id
]
=
$module
;
}
}
/**
* Checks whether the named component exists.
* @param string $id application component ID
...
...
@@ -308,17 +308,17 @@ abstract class Module extends Component implements Initable
/**
* Retrieves the named application component.
* @param string $id application component ID (case-sensitive)
* @param boolean $load
IfNot whether to load the component if it is not yet
.
* @param boolean $load
whether to load the component if it is not yet loaded
.
* @return ApplicationComponent|null the application component instance, null if the application component
* does not exist.
* @see hasComponent()
*/
public
function
getComponent
(
$id
,
$load
IfNot
=
true
)
public
function
getComponent
(
$id
,
$load
=
true
)
{
if
(
isset
(
$this
->
_components
[
$id
]))
{
if
(
$this
->
_components
[
$id
]
instanceof
ApplicationComponent
)
{
return
$this
->
_components
[
$id
];
}
elseif
(
$load
IfNot
)
{
}
elseif
(
$load
)
{
\Yii
::
trace
(
"Loading
\"
$id
\"
application component"
,
__CLASS__
);
return
$this
->
_components
[
$id
]
=
\Yii
::
createObject
(
$this
->
_components
[
$id
]);
}
...
...
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