Yii::app () method detailed
1, Yii::app () returns an object of the current framework application
2, Yii::app () is an object instantiated by the Framework/web/cwebapplication.php class, so you can call properties and methods in Cwebapplication
3, Yii::app () call is the run () method in the Yii class, through which you can call other objects, methods, properties in the system
4, it is recommended not to use Yii::app () Random call Cwebapplication and the parent class CApplication related properties and methods, will affect the stability of the system
5. The components of the system can be called through Yii::app (): Session, DB, user, request, Urlmanager, etc.
Yii::app ()->user (Instantiate Cwebuser class---> "/web/auth/cwebuser.php");
Yii::app ()->db; (Instantiate Cdbconnection class---> "/db/cdbconnection.php")
Yii::app ()->session; (Instantiate Chttpsession class---> "/web/chttpsession.php")
Yii::app ()->request; (Instantiate Cwebuser class---> "/web/auth/cwebuser.php")
Yii::app ()->urlmanager (Instantiate Curlmanager class---> "/web/curlmanager.php");
Description
Framework/yiilite.php: Where is the file for each class name recorded?
Registercorecomponents () method in framework/web/cwebapplication.php: A common component name is recorded
Registercorecomponents () method in framework/base/capplication.php: A common component name is recorded
Yii::app () method detailed