Autoloading

Using the Yii Autoloader Class Map Using Other Autoloaders Autoloading Extension Classes Yii relies on the class autoloading mechanism to locate and include all required class files. It provides a high-performance class autoloader that is compliant with the PSR-4 standard. The autoloader is installed when you include the Yii.php file. Note: For simplicity of description, in this section we will only talk about autoloading of classes. However, keep in mind that the content we are describing he

db\Query create()

create() public static method Creates a new Query object and copies its property values from an existing one. The properties being copies are the ones to be used by query builders. public static yii\db\Query create ( $from )$from yii\db\Query The source query object return yii\db\Query The new Query object

web\XmlResponseFormatter $version

$version public property The XML version public string $version = '1.0'

filters\AccessRule $matchCallback

$matchCallback public property A callback that will be called to determine if the rule should be applied. The signature of the callback should be as follows: function ($rule, $action) where $rule is this rule, and $action is the current action object. The callback should return a boolean value indicating whether this rule should be applied. public callable $matchCallback = null

widgets\ActiveFormAsset $js

$js public property public $js = ['yii.activeForm.js']

Core Validators

boolean captcha compare date default double each email exist file filter image ip in integer match number required safe string trim unique url Yii provides a set of commonly used core validators, found primarily under the yii\validators namespace. Instead of using lengthy validator class names, you may use aliases to specify the use of these core validators. For example, you can use the alias required to refer to the yii\validators\RequiredValidator class: public function rules() { return

validators\FileValidator $extensions

$extensions public property A list of file name extensions that are allowed to be uploaded. This can be either an array or a string consisting of file extension names separated by space or comma (e.g. "gif, jpg"). Extension names are case-insensitive. Defaults to null, meaning all file name extensions are allowed. See also $wrongExtension for the customized message for wrong file type. public array|string $extensions = null

web\UploadedFile $size

$size public property The actual size of the uploaded file in bytes public integer $size = null

db\QueryBuilder buildBetweenCondition()

buildBetweenCondition() public method Creates an SQL expressions with the BETWEEN operator. public string buildBetweenCondition ( $operator, $operands, &$params )$operator string The operator to use (e.g. BETWEEN or NOT BETWEEN) $operands array The first operand is the column name. The second and third operands describe the interval that column value should be in. $params array The binding parameters to be populated return string The generated SQL expression throws yii\base\In

widgets\Menu $labelTemplate

$labelTemplate public property The template used to render the body of a menu which is NOT a link. In this template, the token {label} will be replaced with the label of the menu item. This property will be overridden by the template option set in individual menu items via $items. public string $labelTemplate = '{label}'