Home > Backend Development > PHP Tutorial > What are the predefined components of Yii framework?

What are the predefined components of Yii framework?

WBOY
Release: 2016-07-29 09:13:10
Original
836 people have browsed it

To use PHP's Yii framework, you need to configure a very important file: main.php. To configure a component, you need to specify the class name of the component 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 which components are predefined by Yii and where are they predefined?

First, in the CApplication.php file (https://github.com/yiisoft/yii/blob/1.1.16/framework/base/CApplication.php), the following is predefined Components:

''YII_PATH''array('' ''',
$components=array(
'coreMessages' =>array(
'class'=> 'language'=>
en_us , 'basePath'=>
. DIRECTORY_SEPARATOR.'messages ', ),
db =>
'class'=>
messages' => ,),
'errorHandler
=> array( 'class
=> 'CErrorHandler', ),
'securityManager
=> array( 'class
=> 'statePersister '=> sister',
),
'urlManager'=>array(
'class'=> ;'CUrlManager',
),
'request '=>array(
'class'=>'CHttpRequest',
),
'format'=> 'CFormatter'
),);

Then in the CWebApplication.php file (https://github.com/yiisoft/yii/blob/1.1.16/framework/web/CWebApplication.php), the following components are predefined :

'=>( array(class=>CClientScriptwidgetFactory'=> =>
'Session'=>array(
'class'=> 'CHttpSession',
),
' assetManager'=>array(
'class'=> ),
user'
array 'CWebUser', (
'class' => 'authManager'=>
''=>'CPhpAuthManager',
), 'clientScript'=>
'' ,
), '
array(' class'
The above introduces what are the predefined components of Yii framework? , including Session, Application, and github content. I hope it will be helpful to friends who are interested in PHP tutorials.
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template