Validators used to save and upload files
Validator to validate uploaded and already existing files on the server.
It can be used by being declared inside the yii\base\Model::rues()
method
public function behaviors()
{
return [
['file', FileHandlerValidator::className()],
];
}
The options for this validator are
string : '@web/'
folder to store the files.
string
error message
string
error message
string
error message
callable
a PHP callable that replaces the default implementation of [[fileName()]]. The signature of the callable should be
function ( UploadedFile $file, Model $model, FileHandlerValidator $validator )