web\UploadedFile getInstance()

getInstance() public static method

Returns an uploaded file for the given model attribute.

The file should be uploaded using yii\widgets\ActiveField::fileInput().

See also getInstanceByName().

public static yii\web\UploadedFile getInstance ( $model, $attribute )
$model yii\base\Model

The data model

$attribute string

The attribute name. The attribute name may contain array indexes. For example, '[1]file' for tabular file uploading; and 'file[1]' for an element in a file array.

return yii\web\UploadedFile

The instance of the uploaded file. Null is returned if no file is uploaded for the specified model attribute.

doc_Yii
2016-10-30 17:16:53
Comments
Leave a Comment

Please login to continue.