Property | Type | Description | |
---|---|---|---|
$attributeName | attribute to store name of the uploaded file. | ||
$deleteFileKey | string | ||
$fileInstanceName | the name of the file input field, used to get instance by name. Optional. If not set get instance by model attribute will be used. | ||
$fileName | callback function to generate filename. Optional. If not set, default implementation will be used. | ||
$maxSize | maximum file size. | ||
$minSize | minimum file size. | ||
$requiredOn | scenarios when file upload is required. | ||
$scenarios | allowed scenarios when this behavior will be used. | ||
$types | allowed file types. | ||
$uploadPath | path of the upload directory. |
Property | Type | Description | |
---|---|---|---|
$uploadManager | yupe\components\UploadManager |
Method | Description | |
---|---|---|
addFileInstanceName ( $name ) | ||
attach ( CComponent $owner ) | ||
beforeDelete ( CEvent $event ) | ||
beforeSave ( CModelEvent $event ) : boolean | ||
beforeValidate ( CModelEvent $event ) | ||
checkScenario ( ) : boolean | Checks whether there is a current scenario in allowed scenarios. | |
generateFilename ( ) : string | ||
getFilePath ( ) : mixed | ||
getFileUrl ( ) : string | ||
getUploadPath ( ) : string | ||
saveFile ( ) : void. | Save new uploaded file to disk and set model attribute. |
Method | Description | |
---|---|---|
getUploadedFileInstance ( ) : CUploadedFile | ||
removeFile ( ) : void. | Remove previous uploaded file. |
public addFileInstanceName ( $name ) | ||
$name | string the name of the file input field. |
public beforeSave ( CModelEvent $event ) : boolean | ||
$event | CModelEvent | |
return | boolean |
public checkScenario ( ) : boolean | ||
return | boolean | true if current scenario is allowed. |
public generateFilename ( ) : string | ||
return | string | generated file name. |
public getUploadPath ( ) : string | ||
return | string | path of the upload directory. |
protected getUploadedFileInstance ( ) : CUploadedFile | ||
return | CUploadedFile |
protected removeFile ( ) : void. | ||
return | void. |
public saveFile ( ) : void. | ||
return | void. |
public $fileInstanceName |
public $fileName |
protected UploadManager,yupe\components $uploadManager | ||
return | yupe\components\UploadManager |