validators\FilterValidator $filter

$filter public property The filter. This can be a global function name, anonymous function, etc. The function signature must be as follows, function foo($value) { // compute $newValue here return $newValue; } public callable $filter = null

validators\FileValidator validateValue()

validateValue() protected method Validates a value. A validator class can implement this method to support data validation out of the context of a data model. protected array|null validateValue ( $file )$file return array|null The error message and the parameters to be inserted into the error message. Null should be returned if the data is valid. throws yii\base\NotSupportedException if the validator does not supporting data validation without a model

validators\FileValidator validateMimeType()

validateMimeType() protected method (available since version 2.0.8) Checks the mimeType of the $file against the list in the $mimeTypes property See also $mimeTypes. protected boolean validateMimeType ( $file )$file yii\web\UploadedFile return boolean Whether the $file mimeType is allowed throws yii\base\InvalidConfigException

validators\FileValidator validateExtension()

validateExtension() protected method Checks if given uploaded file have correct type (extension) according current validator settings. protected boolean validateExtension ( $file )$file yii\web\UploadedFile

validators\FileValidator validateAttribute()

validateAttribute() public method Validates a single attribute. Child classes must implement this method to provide the actual validation logic. public void validateAttribute ( $model, $attribute )$model yii\base\Model The data model to be validated $attribute string The name of the attribute to be validated.

validators\FileValidator isEmpty()

isEmpty() public method Checks if the given value is empty. A value is considered empty if it is null, an empty array, or an empty string. Note that this method is different from PHP empty(). It will return false when the value is 0. public boolean isEmpty ( $value, $trim = false )$value mixed The value to be checked $trim return boolean Whether the value is empty

validators\FileValidator init()

init() public method Initializes the object. This method is invoked at the end of the constructor after the object is initialized with the given configuration. public void init ( )

validators\FileValidator getSizeLimit()

getSizeLimit() public method Returns the maximum size allowed for uploaded files. This is determined based on four factors: 'upload_max_filesize' in php.ini 'post_max_size' in php.ini 'MAX_FILE_SIZE' hidden field $maxSize public integer getSizeLimit ( )return integer The size limit for uploaded files.

validators\FileValidator getClientOptions()

getClientOptions() protected method Returns the client-side validation options. protected array getClientOptions ( $model, $attribute )$model yii\base\Model The model being validated $attribute string The attribute name being validated return array The client-side validation options

validators\FileValidator clientValidateAttribute()

clientValidateAttribute() public method Returns the JavaScript needed for performing client-side validation. You may override this method to return the JavaScript validation code if the validator can support client-side validation. The following JavaScript variables are predefined and can be used in the validation code: attribute: an object describing the the attribute being validated. value: the value being validated. messages: an array used to hold the validation error messages for the