2 followers

Yii Framework 1.1 API Documentation

This is the Yii Framework API Documentation. Here you will find detailed information about all classes provided by the Framework. Below you find a list of the existing classes, interfaces, and traits, ordered by their fully qualified name (including the namespace). Each of them has a dedicated page which contains a description about the purpose of the class, a list of the available methods, properties and constants, and detailed description on how to use each of them.

On this page you find all the classes included in version 1.1 of the framework. You can use the dropdown menu on the top right to switch between versions.

You can search API documentation using the search form on the top. You can search for class names and also method and property names, e.g. ActiveRecord.save() or just .save() or ::save().

PackageClassDescription
system Yii Yii is a helper class serving common framework functionalities.
YiiBase YiiBase is a helper class serving common framework functionalities.
system.base CApplication CApplication is the base class for all application classes.
CApplicationComponent CApplicationComponent is the base class for application component classes.
CBehavior CBehavior is a convenient base class for behavior classes.
CComponent CComponent is the base class for all components.
CDbStatePersister CDbStatePersister implements a database persistent data storage.
CEnumerable CEnumerable is the base class for all enumerable types.
CErrorEvent CErrorEvent represents the parameter for the onError event.
CErrorHandler CErrorHandler handles uncaught PHP errors and exceptions.
CEvent CEvent is the base class for all event classes.
CException CException represents a generic exception for all purposes.
CExceptionEvent CExceptionEvent represents the parameter for the onException event.
CHttpException CHttpException represents an exception caused by invalid operations of end-users.
CModel CModel is the base class providing the common features needed by data model objects.
CModelBehavior CModelBehavior is a base class for behaviors that are attached to a model component.
CModelEvent CModelEvent class.
CModule CModule is the base class for module and application classes.
CSecurityManager CSecurityManager provides private keys, hashing and encryption functions.
CStatePersister CStatePersister implements a file-based persistent data storage.
IAction IAction is the interface that must be implemented by controller actions.
IApplicationComponent IApplicationComponent is the interface that all application components must implement.
IAuthManager IAuthManager interface is implemented by an auth manager application component.
IBehavior IBehavior interfaces is implemented by all behavior classes.
IFilter IFilter is the interface that must be implemented by action filters.
IStatePersister IStatePersister is the interface that must be implemented by state persister classes.
IUserIdentity IUserIdentity interface is implemented by a user identity class.
IViewRenderer IViewRenderer interface is implemented by a view renderer class.
IWebServiceProvider IWebServiceProvider interface may be implemented by Web service provider classes.
IWebUser IWebUser interface is implemented by a user application component.
system.caching CApcCache CApcCache provides APC caching in terms of an application component.
CCache CCache is the base class for cache classes with different cache storage implementation.
CDbCache CDbCache implements a cache application component by storing cached data in a database.
CDummyCache CDummyCache is a placeholder cache component.
CEAcceleratorCache CEAcceleratorCache implements a cache application module based on eaccelerator.
CFileCache CFileCache provides a file-based caching mechanism.
CMemCache CMemCache implements a cache application component based on memcached.
CMemCacheServerConfiguration CMemCacheServerConfiguration represents the configuration data for a single memcache server.
CRedisCache CRedisCache implements a cache application component based on redis.
CWinCache CWinCache implements a cache application component based on WinCache.
CXCache CXCache implements a cache application module based on xcache.
CZendDataCache CZendDataCache implements a cache application module based on the Zend Data Cache
ICache ICache is the interface that must be implemented by cache components.
ICacheDependency ICacheDependency is the interface that must be implemented by cache dependency classes.
system.caching.dependencies CCacheDependency CCacheDependency is the base class for cache dependency classes.
CChainedCacheDependency CChainedCacheDependency represents a list of cache dependencies.
CDbCacheDependency CDbCacheDependency represents a dependency based on the query result of a SQL statement.
CDirectoryCacheDependency CDirectoryCacheDependency represents a dependency based on change of a directory.
CExpressionDependency CExpressionDependency represents a dependency based on the result of a PHP expression.
CFileCacheDependency CFileCacheDependency represents a dependency based on a file's last modification time.
CGlobalStateCacheDependency CGlobalStateCacheDependency represents a dependency based on a global state value.
system.collections CAttributeCollection CAttributeCollection implements a collection for storing attribute names and values.
CConfiguration CConfiguration represents an array-based configuration.
CList CList implements an integer-indexed collection class.
CListIterator CListIterator implements an iterator for CList.
CMap CMap implements a collection that takes key-value pairs.
CMapIterator CMapIterator implements an iterator for CMap.
CQueue CQueue implements a queue.
CQueueIterator CQueueIterator implements an iterator for CQueue.
CStack CStack implements a stack.
CStackIterator CStackIterator implements an iterator for CStack.
CTypedList CTypedList represents a list whose items are of the certain type.
CTypedMap CTypedMap represents a map whose items are of the certain type.
system.console CConsoleApplication CConsoleApplication represents a console application.
CConsoleCommand CConsoleCommand represents an executable console command.
CConsoleCommandBehavior CConsoleCommandBehavior is a base class for behaviors that are attached to a console command component.
CConsoleCommandEvent CConsoleCommandEvent class.
CConsoleCommandRunner CConsoleCommandRunner manages commands and executes the requested command.
CHelpCommand CHelpCommand represents a console help command.
system.db CDbCommand CDbCommand represents an SQL statement to execute against a database.
CDbConnection CDbConnection represents a connection to a database.
CDbDataReader CDbDataReader represents a forward-only stream of rows from a query result set.
CDbException CDbException represents an exception that is caused by some DB-related operations.
CDbMigration CDbMigration is the base class for representing a database migration.
CDbTransaction CDbTransaction represents a DB transaction.
system.db.ar CActiveFinder CActiveFinder implements eager loading and lazy loading of related active records.
CActiveRecord CActiveRecord is the base class for classes representing relational data.
CActiveRecordBehavior CActiveRecordBehavior is the base class for behaviors that can be attached to CActiveRecord.
CActiveRecordMetaData CActiveRecordMetaData represents the meta-data for an Active Record class.
CActiveRelation CActiveRelation is the base class for representing active relations that bring back related objects.
CBaseActiveRelation CBaseActiveRelation is the base class for all active relations.
CBelongsToRelation CBelongsToRelation represents the parameters specifying a BELONGS_TO relation.
CHasManyRelation CHasManyRelation represents the parameters specifying a HAS_MANY relation.
CHasOneRelation CHasOneRelation represents the parameters specifying a HAS_ONE relation.
CJoinElement CJoinElement represents a tree node in the join tree created by CActiveFinder.
CJoinQuery CJoinQuery represents a JOIN SQL statement.
CManyManyRelation CManyManyRelation represents the parameters specifying a MANY_MANY relation.
CStatElement CStatElement represents STAT join element for CActiveFinder.
CStatRelation CStatRelation represents a statistical relational query.
system.db.schema CDbColumnSchema CDbColumnSchema class describes the column meta data of a database table.
CDbCommandBuilder CDbCommandBuilder provides basic methods to create query commands for tables.
CDbCriteria CDbCriteria represents a query criteria, such as conditions, ordering by, limit/offset.
CDbExpression CDbExpression represents a DB expression that does not need escaping.
CDbSchema CDbSchema is the base class for retrieving metadata information.
CDbTableSchema CDbTableSchema is the base class for representing the metadata of a database table.
system.db.schema.cubrid CCubridColumnSchema CCubridColumnSchema class describes the column meta data of a CUBRID table.
CCubridSchema CCubridSchema is the class for retrieving metadata information from a CUBRID database (version 8.4.0 and later).
CCubridTableSchema CCubridTableSchema represents the metadata for a CUBRID database table.
system.db.schema.mssql CMssqlColumnSchema CMssqlColumnSchema class describes the column meta data of a MSSQL table.
CMssqlCommandBuilder CMssqlCommandBuilder provides basic methods to create query commands for tables for Mssql Servers.
CMssqlPdoAdapter This is an extension of default PDO class for mssql driver only
CMssqlSchema CMssqlSchema is the class for retrieving metadata information from a MS SQL Server database.
CMssqlSqlsrvPdoAdapter This is an extension of default PDO class for MSSQL SQLSRV driver only.
CMssqlTableSchema CMssqlTableSchema represents the metadata for a MSSQL table.
system.db.schema.mysql CMysqlColumnSchema CMysqlColumnSchema class describes the column meta data of a MySQL table.
CMysqlCommandBuilder CMysqlCommandBuilder provides basic methods to create query commands for tables.
CMysqlSchema CMysqlSchema is the class for retrieving metadata information from a MySQL database (version 4.1.x and 5.x).
CMysqlTableSchema CMysqlTableSchema represents the metadata for a MySQL table.
system.db.schema.oci COciColumnSchema COciColumnSchema class describes the column meta data of an Oracle table.
COciCommandBuilder COciCommandBuilder provides basic methods to create query commands for tables.
COciSchema COciSchema is the class for retrieving metadata information from an Oracle database.
COciTableSchema COciTableSchema represents the metadata for an Oracle table.
system.db.schema.pgsql CPgsqlColumnSchema CPgsqlColumnSchema class describes the column meta data of a PostgreSQL table.
CPgsqlCommandBuilder CPgsqlCommandBuilder provides basic methods to create query commands for tables.
CPgsqlSchema CPgsqlSchema is the class for retrieving metadata information from a PostgreSQL database.
CPgsqlTableSchema CPgsqlTable represents the metadata for a PostgreSQL table.
system.db.schema.sqlite CSqliteColumnSchema CSqliteColumnSchema class describes the column meta data of a SQLite table.
CSqliteCommandBuilder CSqliteCommandBuilder provides basic methods to create query commands for SQLite tables.
CSqliteSchema CSqliteSchema is the class for retrieving metadata information from a SQLite (2/3) database.
system.gii CCodeFile CCodeFile represents a code file being generated.
CCodeForm CCodeForm represents the form for collecting code generation parameters.
CCodeGenerator CCodeGenerator is the base class for code generator classes.
CCodeModel CCodeModel is the base class for model classes that are used to generate code.
GiiModule GiiModule is a module that provides Web-based code generation capabilities.
system.i18n CChoiceFormat CChoiceFormat is a helper that chooses an appropriate message based on the specified number value.
CDateFormatter CDateFormatter provides date/time localization functionalities.
CDbMessageSource CDbMessageSource represents a message source that stores translated messages in database.
CGettextMessageSource CGettextMessageSource represents a message source that is based on GNU Gettext.
CLocale CLocale represents the data relevant to a locale.
CMessageSource CMessageSource is the base class for message translation repository classes.
CMissingTranslationEvent CMissingTranslationEvent represents the parameter for the onMissingTranslation event.
CNumberFormatter CNumberFormatter provides number localization functionalities.
CPhpMessageSource CPhpMessageSource represents a message source that stores translated messages in PHP scripts.
system.i18n.gettext CGettextFile CGettextFile is the base class for representing a Gettext message file.
CGettextMoFile CGettextMoFile represents an MO Gettext message file.
CGettextPoFile CGettextPoFile represents a PO Gettext message file.
system.logging CChainedLogFilter CChainedLogFilter allows you to attach multiple log filters to a log route (See CLogRoute::$filter for details).
CDbLogRoute CDbLogRoute stores log messages in a database table.
CEmailLogRoute CEmailLogRoute sends selected log messages to email addresses.
CFileLogRoute CFileLogRoute records log messages in files.
CLogFilter CLogFilter preprocesses the logged messages before they are handled by a log route.
CLogRoute CLogRoute is the base class for all log route classes.
CLogRouter CLogRouter manages log routes that record log messages in different media.
CLogger CLogger records log messages in memory.
CProfileLogRoute CProfileLogRoute displays the profiling results in Web page.
CSysLogRoute CSysLogRoute dumps log messages to syslog.
CWebLogRoute CWebLogRoute shows the log content in Web page.
ILogFilter ILogFilter is the interface that must be implemented by log filters.
system.test CDbFixtureManager CDbFixtureManager manages database fixtures during tests.
CDbTestCase CDbTestCase is the base class for test cases about DB-related features.
CTestCase CTestCase is the base class for all test case classes.
CWebTestCase CWebTestCase is the base class for Web-based functional test case classes.
system.utils CDateTimeParser CDateTimeParser converts a date/time string to a UNIX timestamp according to the specified pattern.
CFileHelper CFileHelper provides a set of helper methods for common file system operations.
CFormatter CFormatter provides a set of commonly used data formatting methods.
CLocalizedFormatter CLocalizedFormatter provides a set of commonly used data formatting methods based on the current locale settings.
CMarkdownParser CMarkdownParser is a wrapper of MarkdownExtra_Parser.
CPasswordHelper CPasswordHelper provides a simple API for secure password hashing and verification.
CPropertyValue CPropertyValue is a helper class that provides static methods to convert component property values to specific types.
CTimestamp CTimestamp represents a timestamp.
CVarDumper CVarDumper is intended to replace the buggy PHP function var_dump and print_r.
system.validators CBooleanValidator CBooleanValidator validates that the attribute value is either trueValue or falseValue.
CCaptchaValidator CCaptchaValidator validates that the attribute value is the same as the verification code displayed in the CAPTCHA.
CCompareValidator CCompareValidator compares the specified attribute value with another value and validates if they are equal.
CDateValidator CDateValidator verifies if the attribute represents a date, time or datetime.
CDefaultValueValidator CDefaultValueValidator sets the attributes with the specified value.
CEmailValidator CEmailValidator validates that the attribute value is a valid email address.
CExistValidator CExistValidator validates that the attribute value exists in a table.
CFileValidator CFileValidator verifies if an attribute is receiving a valid uploaded file.
CFilterValidator CFilterValidator transforms the data being validated based on a filter.
CInlineValidator CInlineValidator represents a validator which is defined as a method in the object being validated.
CNumberValidator CNumberValidator validates that the attribute value is a number.
CRangeValidator CRangeValidator validates that the attribute value is among the list (specified via range).
CRegularExpressionValidator CRegularExpressionValidator validates that the attribute value matches to the specified regular expression.
CRequiredValidator CRequiredValidator validates that the specified attribute does not have null or empty value.
CSafeValidator CSafeValidator marks the associated attributes to be safe for massive assignments.
CStringValidator CStringValidator validates that the attribute value is of certain length.
CTypeValidator CTypeValidator verifies if the attribute is of the type specified by type.
CUniqueValidator CUniqueValidator validates that the attribute value is unique in the corresponding database table.
CUnsafeValidator CUnsafeValidator marks the associated attributes to be unsafe so that they cannot be massively assigned.
CUrlValidator CUrlValidator validates that the attribute value is a valid http or https URL.
CValidator CValidator is the base class for all validators.
system.web CActiveDataProvider CActiveDataProvider implements a data provider based on ActiveRecord.
CArrayDataProvider CArrayDataProvider implements a data provider based on a raw data array.
CAssetManager CAssetManager is a Web application component that manages private files (called assets) and makes them accessible by Web clients.
CBaseController CBaseController is the base class for CController and CWidget.
CBaseUrlRule CBaseUrlRule is the base class for a URL rule class.
CCacheHttpSession CCacheHttpSession implements a session component using cache as storage medium.
CClientScript CClientScript manages JavaScript and CSS stylesheets for views.
CController CController manages a set of actions which deal with the corresponding user requests.
CCookieCollection CCookieCollection implements a collection class to store cookies.
CDataProvider CDataProvider is a base class that implements the IDataProvider interface.
CDataProviderIterator CDataProviderIterator allows iteration over large data sets without holding the entire set in memory.
CDbHttpSession CDbHttpSession extends CHttpSession by using database as session data storage.
CExtController CExtController is the base class for controllers distributed as extension.
CFormModel CFormModel represents a data model that collects HTML form inputs.
CHttpCookie A CHttpCookie instance stores a single cookie, including the cookie name, value, domain, path, expire, and secure.
CHttpRequest CHttpRequest encapsulates the $_SERVER variable and resolves its inconsistency among different Web servers.
CHttpSession CHttpSession provides session-level data management and the related configurations.
CHttpSessionIterator CHttpSessionIterator implements an iterator for CHttpSession.
COutputEvent COutputEvent represents the parameter for events related with output handling.
CPagination CPagination represents information relevant to pagination.
CSort CSort represents information relevant to sorting.
CSqlDataProvider CSqlDataProvider implements a data provider based on a plain SQL statement.
CTheme CTheme represents an application theme.
CThemeManager CThemeManager manages the themes for the Web application.
CUploadedFile CUploadedFile represents the information for an uploaded file.
CUrlManager CUrlManager manages the URLs of Yii Web applications.
CUrlRule CUrlRule represents a URL formatting/parsing rule.
CWebApplication CWebApplication extends CApplication by providing functionalities specific to Web requests.
CWebModule CWebModule represents an application module.
CWidgetFactory CWidgetFactory creates new widgets to be used in views.
IDataProvider IDataProvider is the interface that must be implemented by data provider classes.
IWidgetFactory IWidgetFactory is the interface that must be implemented by a widget factory class.
system.web.actions CAction CAction is the base class for all controller action classes.
CInlineAction CInlineAction represents an action that is defined as a controller method.
CViewAction CViewAction represents an action that displays a view according to a user-specified parameter.
system.web.auth CAccessControlFilter CAccessControlFilter performs authorization checks for the specified actions.
CAccessRule CAccessRule represents an access rule that is managed by CAccessControlFilter.
CAuthAssignment CAuthAssignment represents an assignment of a role to a user.
CAuthItem CAuthItem represents an authorization item.
CAuthManager CAuthManager is the base class for authorization manager classes.
CBaseUserIdentity CBaseUserIdentity is a base class implementing IUserIdentity.
CDbAuthManager CDbAuthManager represents an authorization manager that stores authorization information in database.
CPhpAuthManager CPhpAuthManager represents an authorization manager that stores authorization information in terms of a PHP script file.
CUserIdentity CUserIdentity is a base class for representing identities that are authenticated based on a username and a password.
CWebUser CWebUser represents the persistent state for a Web application user.
system.web.filters CFilter CFilter is the base class for all filters.
CFilterChain CFilterChain represents a list of filters being applied to an action.
CHttpCacheFilter CHttpCacheFilter implements http caching. It works a lot like COutputCache
CInlineFilter CInlineFilter represents a filter defined as a controller method.
system.web.form CForm CForm represents a form object that contains form input specifications.
CFormButtonElement CFormButtonElement represents a form button element.
CFormElement CFormElement is the base class for presenting all kinds of form element.
CFormElementCollection CFormElementCollection implements the collection for storing form elements.
CFormInputElement CFormInputElement represents form input element.
CFormStringElement CFormStringElement represents a string in a form.
system.web.helpers CGoogleApi CGoogleApi provides helper methods to easily access the Google API loader.
CHtml CHtml is a static class that provides a collection of helper methods for creating HTML views.
CJSON CJSON converts PHP data to and from JSON format.
CJavaScript CJavaScript is a helper class containing JavaScript-related handling functions.
CJavaScriptExpression CJavaScriptExpression represents a JavaScript expression that does not need escaping.
system.web.renderers CPradoViewRenderer CPradoViewRenderer implements a view renderer that allows users to use a template syntax similar to PRADO templates.
CViewRenderer CViewRenderer is the base class for view renderer classes.
system.web.services CDocumentSoapObjectWrapper CDocumentSoapObjectWrapper is a wrapper class internally used
CSoapObjectWrapper CSoapObjectWrapper is a wrapper class internally used when SoapServer::setObject() is not defined.
CWebService CWebService encapsulates SoapServer and provides a WSDL-based web service.
CWebServiceAction CWebServiceAction implements an action that provides Web services.
CWsdlGenerator CWsdlGenerator generates the WSDL for a given service class.
system.web.widgets CActiveForm CActiveForm provides a set of methods that can help to simplify the creation
CAutoComplete CAutoComplete generates an auto-complete text field.
CClipWidget CClipWidget records its content and makes it available elsewhere.
CContentDecorator CContentDecorator decorates the content it encloses with the specified view.
CFilterWidget CFilterWidget is the base class for widgets that can also be used as filters.
CFlexWidget CFlexWidget embeds a Flex 3.x application into a page.
CHtmlPurifier CHtmlPurifier is wrapper of HTML Purifier.
CInputWidget CInputWidget is the base class for widgets that collect user inputs.
CMarkdown CMarkdown converts the captured content from markdown syntax to HTML code.
CMaskedTextField CMaskedTextField generates a masked text field.
CMultiFileUpload CMultiFileUpload generates a file input that can allow uploading multiple files at a time.
COutputCache COutputCache enables caching the output generated by an action or a view fragment.
COutputProcessor COutputProcessor transforms the content into a different format.
CStarRating CStarRating displays a star rating control that can collect user rating input.
CTabView CTabView displays contents in multiple tabs.
CTextHighlighter CTextHighlighter does syntax highlighting for its body content.
CTreeView CTreeView displays a tree view of hierarchical data.
CWidget CWidget is the base class for widgets.
system.web.widgets.captcha CCaptcha CCaptcha renders a CAPTCHA image element.
CCaptchaAction CCaptchaAction renders a CAPTCHA image.
system.web.widgets.pagers CBasePager CBasePager is the base class for all pagers.
CLinkPager CLinkPager displays a list of hyperlinks that lead to different pages of target.
CListPager CListPager displays a dropdown list that contains options leading to different pages of target.
zii.behaviors CTimestampBehavior CTimestampBehavior will automatically fill date and time related attributes.
zii.widgets CBaseListView CBaseListView is the base class for CListView and CGridView.
CBreadcrumbs CBreadcrumbs displays a list of links indicating the position of the current page in the whole website.
CDetailView CDetailView displays the detail of a single data model.
CListView CListView displays a list of data items in terms of a list.
CMenu CMenu displays a multi-level menu using nested HTML lists.
CPortlet CPortlet is the base class for portlet widgets.
zii.widgets.grid CButtonColumn CButtonColumn represents a grid view column that renders one or several buttons.
CCheckBoxColumn CCheckBoxColumn represents a grid view column of checkboxes.
CDataColumn CDataColumn represents a grid view column that is associated with a data attribute or PHP expression.
CGridColumn CGridColumn is the base class for all grid view column classes.
CGridView CGridView displays a list of data items in terms of a table.
CLinkColumn CLinkColumn represents a grid view column that renders a hyperlink in each of its data cells.
zii.widgets.jui CJuiAccordion CJuiAccordion displays an accordion widget.
CJuiAutoComplete CJuiAutoComplete displays an autocomplete field.
CJuiButton CJuiButton displays a button widget.
CJuiDatePicker CJuiDatePicker displays a datepicker.
CJuiDialog CJuiDialog displays a dialog widget.
CJuiDraggable CJuiDraggable displays a draggable widget.
CJuiDroppable CJuiDroppable displays a droppable widget.
CJuiInputWidget CJuiInputWidget is the base class for JUI widgets that can collect user input.
CJuiProgressBar CJuiProgressBar displays a progress bar widget.
CJuiResizable CJuiResizable displays a resizable widget.
CJuiSelectable CJuiSelectable displays an accordion widget.
CJuiSlider CJuiSlider displays a slider.
CJuiSliderInput CJuiSliderInput displays a slider. It can be used in forms and post its value.
CJuiSortable CJuiSortable makes selected elements sortable by dragging with the mouse.
CJuiTabs CJuiTabs displays a tabs widget.
CJuiWidget This is the base class for all JUI widget classes.