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
f8fda79a
Commit
f8fda79a
authored
Jul 04, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #4192.
parent
acaa4f81
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
structure-applications.md
docs/guide/structure-applications.md
+20
-2
No files found.
docs/guide/structure-applications.md
View file @
f8fda79a
...
@@ -110,6 +110,7 @@ Each component listed in this property may be specified in one of the following
...
@@ -110,6 +110,7 @@ Each component listed in this property may be specified in one of the following
-
a module ID as specified via
[
modules
](
#modules
)
.
-
a module ID as specified via
[
modules
](
#modules
)
.
-
a class name.
-
a class name.
-
a configuration array.
-
a configuration array.
-
an anonymous function that creates and returns a component.
For example,
For example,
...
@@ -120,17 +121,34 @@ For example,
...
@@ -120,17 +121,34 @@ For example,
'demo'
,
'demo'
,
// a class name
// a class name
'app\components\
TrafficMonito
r'
,
'app\components\
Profile
r'
,
// a configuration array
// a configuration array
[
[
'class'
=>
'app\components\Profiler'
,
'class'
=>
'app\components\Profiler'
,
'level'
=>
3
,
'level'
=>
3
,
]
],
// an anonymous function
function
()
{
return
\app\components\Profiler
();
}
],
],
]
]
```
```
> Info: If a module ID is the same as an application component ID, the application component will be used during
the bootstrapping process. If you want to use the module instead, you may specify it using an anonymous function
like the following:
>```php
[
function () {
return
\Y
ii::$app->getModule('user');
},
]
```
During the bootstrapping process, each component will be instantiated. If the component class
During the bootstrapping process, each component will be instantiated. If the component class
implements [[yii\base\BootstrapInterface]], its [[yii\base\BootstrapInterface::bootstrap()|bootstrap()]] method
implements [[yii\base\BootstrapInterface]], its [[yii\base\BootstrapInterface::bootstrap()|bootstrap()]] method
will be also be called.
will be also be called.
...
...
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