Using the PHP yii framework, you need to configure a very important file: main.php. Configuring components requires the class name of the component to be specified through the ' class ' field, but some do not need to be specified because they are predefined components of the YII framework, such as the ' DB ' component.
So, do you know what components are pre-defined by Yii, and where are they predefined?
First, in the Capplication. php file (https://GitHub. com/yiisoft/yii/blob/1.1.16/framework/base/c Application. php), the following components are pre-defined:
$components = Array ( |
|
'coremessages'=array( |
|
'class'='cphpmessagesource', |
|
' Language '='en_us', |
|
'basepath'=yii_path. Directory_separator . 'messages', |
|
), |
|
'db'= =array( |
|
'class'='cdbconnection', |
|
), |
|
'messages'=array( |
|
'class'='cphpmessagesource', |
|
), |
|
'errorhandler'=array( |
|
'class'='cerrorhandler', |
|
), |
|
'securitymanager'=array( |
|
'class'='csecuritymanager', |
|
), |
|
'statepersister'=array( |
|
'class'='cstatepersister', |
|
), |
|
'urlmanager'=array( |
|
'class'='curlmanager', |
|
), |
|
'request'= =array( |
|
'class'='chttprequest', |
|
), |
|
'format'= =array( |
|
'class'='cformatter', |
|
), |
|
); |
Then in CWebapplication. php file (https://GitHub. Com/yiisoft/yii/blob/1.1.16/framework/web/cweb application. php), pre-defined the following components:
' Session ' = Array ( |
|
'class'='chttpSession', |
|
), |
|
'assetmanager'=array( |
|
'class'='cassetmanager', |
|
), |
|
'user'= =array( |
|
'class'='cwebuser', |
|
), |
|
'thememanager'=array( |
|
'class'='cthememanager', |
|
), |
|
'AuthManager'=array( |
|
'class'='cphpauthmanager', |
|
), |
|
'clientscript'=array( |
|
'class'='cclientscript', |
|
), |
|
'widgetfactory'=array( |
|
'class'='cwidgetfactory', |
|
), |
What are the predefined components of the YII framework described above? , including the content of the Session,application,github, I hope to be interested in PHP tutorial friends helpful.