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. |
Please login to continue.