Yii Learning (3) ---- core application components

Source: Internet
Author: User

Core application components: Yii predefines a series of core application components to provide functions used in common Web applications. For example, the request component is used to parse user requests and provide information such as URLs and cookies. By configuring the attributes of these core components, we can modify the default behavior of Yii almost arbitrarily. The Core Components predefined by CWebApplication are listed below. AssetManager: CAssetManager-manage the publishing of private resource files. AuthManager: CAuthManager-manage role-based access control (RBAC). cache: CCache-provides the data cache function. Note: You must specify the actual class (such as CMemCache and CDbCache ). Otherwise, NULL is returned when you access this component. ClientScript: CClientScript-manage client scripts (javascripts and CSS). coreMessages: CPhpMessageSource-Provides translation of core information used by the Yii framework. Db: CDbConnection-provides database connection. Note: To use this component, you must configure its connectionString attribute. ErrorHandler: CErrorHandler-handle uncaptured PHP errors and exceptions. Format: CFormatter-format the value display. This function is available from version 1.1.0. Messages: CPhpMessageSource-Provides information translation for Yii applications. Request: CHttpRequest-provides information about user requests. SecurityManager: CSecurityManager-Provides security-related services, such as hash and encryption. Session: CHttpSession-Provides session-related functions. StatePersister: CStatePersister-provides a global state persistence method. UrlManager: CUrlManager-Provides URL parsing and creation functions. user: CWebUser-provides recognition information for the current user. Themanager: CThemeManager-manage topics. To access an application component, use the Yii: app ()-> component ID

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.