Yii predefines a set of core application components to provide features common among Web applications. For example, the request component is used to collect information about a user request and provide information such as the requested URL and cookies. By configuring the properties of these core components, we can change the default behavior of nearly every aspect of Yii.
Yii core components that are pre-declared by CWebApplication
• assetManager: CAssetManager – manages the publishing of private asset files.
• authManager: CAuthManager – manages role-based access control (RBAC).
• cache: CCache – provides data caching functionality. Note, you must specify the actual class (e.g.CMemCache, CDbCache). Otherwise, null will be returned when you access this component.
• coreMessages: CPhpMessageSource – provides translated core messages used by the Yii framework.
• db: CDbConnection – provides the database connection. Note, you must configure its connectionStringproperty in order to use this component.
• errorHandler: CErrorHandler – handles uncaught PHP errors and exceptions.
• format: CFormatter – formats data values for display purpose.
• messages: CPhpMessageSource – provides translated messages used by the Yii application.
• request: CHttpRequest – provides information related to user requests.
• securityManager: CSecurityManager – provides security-related services, such as hashing and encryption.
• session: CHttpSession – provides session-related functionality.
• statePersister: CStatePersister – provides the mechanism for persisting global state.
• urlManager: CUrlManager – provides URL parsing and creation functionality.
• user: CWebUser – carries identity-related information about the current user.
• themeManager: CThemeManager – manages themes.