Yii PHP Framework Version 2 ¶
This is the core framework code of Yii 2.
Installation ¶
The preferred way to install the Yii framework is through composer.
Either run
php composer.phar require --prefer-dist "yiisoft/yii2 *"
or add
"yiisoft/yii2": "*"
to the require section of your composer.json.
Class Reference
Class | Description |
---|---|
Yii | Yii is a helper class serving common framework functionalities. |
yii\BaseYii | BaseYii is the core helper class for the Yii framework. |
yii\base\Action | Action is the base class for all controller action classes. |
yii\base\ActionEvent | ActionEvent represents the event parameter used for an action event. |
yii\base\ActionFilter | ActionFilter is the base class for action filters. |
yii\base\Application | Application is the base class for all application classes. |
yii\base\ArrayAccessTrait | ArrayAccessTrait provides the implementation for IteratorAggregate, ArrayAccess and Countable. |
yii\base\Arrayable | Arrayable is the interface that should be implemented by classes who want to support customizable representation of their instances. |
yii\base\ArrayableTrait | ArrayableTrait provides a common implementation of the yii\base\Arrayable interface. |
yii\base\Behavior | Behavior is the base class for all behavior classes. |
yii\base\BootstrapInterface | BootstrapInterface is the interface that should be implemented by classes who want to participate in the application bootstrap process. |
yii\base\Component | Component is the base class that implements the property, event and behavior features. |
yii\base\Controller | Controller is the base class for classes containing controller logic. |
yii\base\DynamicModel | DynamicModel is a model class primarily used to support ad-hoc data validation. |
yii\base\ErrorException | ErrorException represents a PHP error. |
yii\base\ErrorHandler | ErrorHandler handles uncaught PHP errors and exceptions. |
yii\base\Event | Event is the base class for all event classes. |
yii\base\Exception | Exception represents a generic exception for all purposes. |
yii\base\ExitException | ExitException represents a normal termination of an application. |
yii\base\Formatter | Formatter provides a set of commonly used data formatting methods. |
yii\base\InlineAction | InlineAction represents an action that is defined as a controller method. |
yii\base\InvalidCallException | InvalidCallException represents an exception caused by calling a method in a wrong way. |
yii\base\InvalidConfigException | InvalidConfigException represents an exception caused by incorrect object configuration. |
yii\base\InvalidParamException | InvalidParamException represents an exception caused by invalid parameters passed to a method. |
yii\base\InvalidRouteException | InvalidRouteException represents an exception caused by an invalid route. |
yii\base\MailEvent | ActionEvent represents the event parameter used for an action event. |
yii\base\Model | Model is the base class for data models. |
yii\base\ModelEvent | ModelEvent class. |
yii\base\Module | Module is the base class for module and application classes. |
yii\base\NotSupportedException | NotSupportedException represents an exception caused by accessing features that are not supported. |
yii\base\Object | Object is the base class that implements the property feature. |
yii\base\Request | Request represents a request that is handled by an yii\base\Application. |
yii\base\Response | Response represents the response of an yii\base\Application to a yii\base\Request. |
yii\base\Theme | Theme represents an application theme. |
yii\base\UnknownClassException | UnknownClassException represents an exception caused by using an unknown class. |
yii\base\UnknownMethodException | UnknownMethodException represents an exception caused by accessing an unknown object method. |
yii\base\UnknownPropertyException | UnknownPropertyException represents an exception caused by accessing unknown object properties. |
yii\base\UserException | UserException is the base class for exceptions that are meant to be shown to end users. |
yii\base\View | View represents a view object in the MVC pattern. |
yii\base\ViewContextInterface | ViewContextInterface is the interface that should implemented by classes who want to support relative view names. |
yii\base\ViewEvent | ViewEvent represents events triggered by the yii\base\View component. |
yii\base\ViewRenderer | ViewRenderer is the base class for view renderer classes. |
yii\base\Widget | Widget is the base class for widgets. |
yii\behaviors\AttributeBehavior | AttributeBehavior automatically assigns a specified value to one or multiple attributes of an ActiveRecord object when certain events happen. |
yii\behaviors\BlameableBehavior | BlameableBehavior automatically fills the specified attributes with the current user ID. |
yii\behaviors\TimestampBehavior | TimestampBehavior automatically fills the specified attributes with the current timestamp. |
yii\caching\ApcCache | ApcCache provides APC caching in terms of an application component. |
yii\caching\Cache | Cache is the base class for cache classes supporting different cache storage implementation. |
yii\caching\ChainedDependency | ChainedDependency represents a dependency which is composed of a list of other dependencies. |
yii\caching\DbCache | DbCache implements a cache application component by storing cached data in a database. |
yii\caching\DbDependency | DbDependency represents a dependency based on the query result of a SQL statement. |
yii\caching\Dependency | Dependency is the base class for cache dependency classes. |
yii\caching\DummyCache | DummyCache is a placeholder cache component. |
yii\caching\ExpressionDependency | ExpressionDependency represents a dependency based on the result of a PHP expression. |
yii\caching\FileCache | FileCache implements a cache component using files. |
yii\caching\FileDependency | FileDependency represents a dependency based on a file's last modification time. |
yii\caching\GroupDependency | GroupDependency marks a cached data item with a group name. |
yii\caching\MemCache | MemCache implements a cache application component based on memcache and memcached. |
yii\caching\MemCacheServer | MemCacheServer represents the configuration data for a single memcache or memcached server. |
yii\caching\WinCache | WinCache provides Windows Cache caching in terms of an application component. |
yii\caching\XCache | XCache provides XCache caching in terms of an application component. |
yii\caching\ZendDataCache | ZendDataCache provides Zend data caching in terms of an application component. |
yii\captcha\Captcha | Captcha renders a CAPTCHA image and an input field that takes user-entered verification code. |
yii\captcha\CaptchaAction | CaptchaAction renders a CAPTCHA image. |
yii\captcha\CaptchaAsset | This asset bundle provides the javascript files needed for the yii\captcha\Captcha widget. |
yii\captcha\CaptchaValidator | CaptchaValidator validates that the attribute value is the same as the verification code displayed in the CAPTCHA. |
yii\console\Application | Application represents a console application. |
yii\console\Controller | Controller is the base class of console command classes. |
yii\console\ErrorHandler | ErrorHandler handles uncaught PHP errors and exceptions. |
yii\console\Exception | Exception represents an exception caused by incorrect usage of a console command. |
yii\console\Request | The console Request represents the environment information for a console application. |
yii\console\Response | The console Response represents the result of a console application. |
yii\console\controllers\AssetController | Allows you to combine and compress your JavaScript and CSS files. |
yii\console\controllers\CacheController | Allows you to flush cache. |
yii\console\controllers\FixtureController | Manages loading and unloading fixtures. |
yii\console\controllers\HelpController | Provides help information about console commands. |
yii\console\controllers\MessageController | Extracts messages to be translated from source files. |
yii\console\controllers\MigrateController | Manages application migrations. |
yii\data\ActiveDataProvider | ActiveDataProvider implements a data provider based on yii\db\Query and yii\db\ActiveQuery. |
yii\data\ArrayDataProvider | ArrayDataProvider implements a data provider based on a data array. |
yii\data\BaseDataProvider | BaseDataProvider provides a base class that implements the yii\data\DataProviderInterface. |
yii\data\DataProviderInterface | DataProviderInterface is the interface that must be implemented by data provider classes. |
yii\data\Pagination | Pagination represents information relevant to pagination of data items. |
yii\data\Sort | Sort represents information relevant to sorting. |
yii\data\SqlDataProvider | SqlDataProvider implements a data provider based on a plain SQL statement. |
yii\db\ActiveQuery | ActiveQuery represents a DB query associated with an Active Record class. |
yii\db\ActiveQueryInterface | ActiveQueryInterface defines the common interface to be implemented by active record query classes. |
yii\db\ActiveQueryTrait | ActiveQueryTrait implements the common methods and properties for active record query classes. |
yii\db\ActiveRecord | ActiveRecord is the base class for classes representing relational data in terms of objects. |
yii\db\ActiveRecordInterface | ActiveRecordInterface |
yii\db\ActiveRelationTrait | ActiveRelationTrait implements the common methods and properties for active record relational queries. |
yii\db\BaseActiveRecord | ActiveRecord is the base class for classes representing relational data in terms of objects. |
yii\db\BatchQueryResult | BatchQueryResult represents a batch query from which you can retrieve data in batches. |
yii\db\ColumnSchema | ColumnSchema class describes the metadata of a column in a database table. |
yii\db\Command | Command represents a SQL statement to be executed against a database. |
yii\db\Connection | Connection represents a connection to a database via PDO. |
yii\db\DataReader | DataReader represents a forward-only stream of rows from a query result set. |
yii\db\Exception | Exception represents an exception that is caused by some DB-related operations. |
yii\db\Expression | Expression represents a DB expression that does not need escaping or quoting. |
yii\db\Migration | Migration is the base class for representing a database migration. |
yii\db\Query | Query represents a SELECT SQL statement in a way that is independent of DBMS. |
yii\db\QueryBuilder | QueryBuilder builds a SELECT SQL statement based on the specification given as a yii\db\Query object. |
yii\db\QueryInterface | The QueryInterface defines the minimum set of methods to be implemented by a database query. |
yii\db\QueryTrait | The BaseQuery trait represents the minimum method set of a database Query. |
yii\db\Schema | Schema is the base class for concrete DBMS-specific schema classes. |
yii\db\StaleObjectException | |
yii\db\TableSchema | TableSchema represents the metadata of a database table. |
yii\db\Transaction | Transaction represents a DB transaction. |
yii\db\cubrid\QueryBuilder | QueryBuilder is the query builder for CUBRID databases (version 9.1.x and higher). |
yii\db\cubrid\Schema | Schema is the class for retrieving metadata from a CUBRID database (version 9.1.x and higher). |
yii\db\mssql\PDO | This is an extension of the default PDO class of MSSQL and DBLIB drivers. |
yii\db\mssql\QueryBuilder | QueryBuilder is the query builder for MS SQL Server databases (version 2008 and above). |
yii\db\mssql\Schema | Schema is the class for retrieving metadata from a MS SQL Server databases (version 2008 and above). |
yii\db\mssql\SqlsrvPDO | This is an extension of the default PDO class of SQLSRV driver. |
yii\db\mssql\TableSchema | TableSchema represents the metadata of a database table. |
yii\db\mysql\QueryBuilder | QueryBuilder is the query builder for MySQL databases. |
yii\db\mysql\Schema | Schema is the class for retrieving metadata from a MySQL database (version 4.1.x and 5.x). |
yii\db\oci\QueryBuilder | QueryBuilder is the query builder for Oracle databases. |
yii\db\oci\Schema | Schema is the class for retrieving metadata from an Oracle database |
yii\db\pgsql\QueryBuilder | QueryBuilder is the query builder for PostgreSQL databases. |
yii\db\pgsql\Schema | Schema is the class for retrieving metadata from a PostgreSQL database (version 9.x and above). |
yii\db\sqlite\QueryBuilder | QueryBuilder is the query builder for SQLite databases. |
yii\db\sqlite\Schema | Schema is the class for retrieving metadata from a SQLite (2/3) database. |
yii\di\Container | Container implements a dependency injection container. |
yii\di\Instance | Instance represents a reference to a named object in a dependency injection (DI) container or a service locator. |
yii\di\ServiceLocator | ServiceLocator implements a service locator. |
yii\filters\AccessControl | AccessControl provides simple access control based on a set of rules. |
yii\filters\AccessRule | This class represents an access rule defined by the yii\filters\AccessControl action filter |
yii\filters\ContentNegotiator | ContentNegotiator supports response format negotiation and application language negotiation. |
yii\filters\HttpCache | The HttpCache provides functionality for caching via HTTP Last-Modified and Etag headers. |
yii\filters\PageCache | The PageCache provides functionality for whole page caching |
yii\filters\RateLimitInterface | RateLimitInterface is the interface that may be implemented by an identity object to enforce rate limiting. |
yii\filters\RateLimiter | RateLimiter implements a rate limiting algorithm based on the leaky bucket algorithm. |
yii\filters\VerbFilter | VerbFilter is an action filter that filters by HTTP request methods. |
yii\filters\auth\AuthInterface | AuthInterface is the interface that should be implemented by auth method classes. |
yii\filters\auth\AuthMethod | AuthMethod is a base class implementing the yii\filters\auth\AuthInterface interface. |
yii\filters\auth\CompositeAuth | CompositeAuth is an action filter that supports multiple authentication methods at the same time. |
yii\filters\auth\HttpBasicAuth | HttpBasicAuth is an action filter that supports the HTTP Basic authentication method. |
yii\filters\auth\HttpBearerAuth | HttpBearerAuth is an action filter that supports the authentication method based on HTTP Bearer token. |
yii\filters\auth\QueryParamAuth | QueryParamAuth is an action filter that supports the authentication based on the access token passed through a query parameter. |
yii\grid\ActionColumn | ActionColumn is a column for the yii\grid\GridView widget that displays buttons for viewing and manipulating the items. |
yii\grid\CheckboxColumn | CheckboxColumn displays a column of checkboxes in a grid view. |
yii\grid\Column | Column is the base class of all yii\grid\GridView column classes. |
yii\grid\DataColumn | DataColumn is the default column type for the yii\grid\GridView widget. |
yii\grid\GridView | The GridView widget is used to display data in a grid. |
yii\grid\GridViewAsset | This asset bundle provides the javascript files for the yii\grid\GridView widget. |
yii\grid\SerialColumn | SerialColumn displays a column of row numbers (1-based). |
yii\helpers\ArrayHelper | ArrayHelper provides additional array functionality that you can use in your application. |