프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$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. |
프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$uploadManager | yupe\components\UploadManager |
메소드 | 설명 | |
---|---|---|
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. |
메소드 | 설명 | |
---|---|---|
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 | |
리턴 | boolean |
public checkScenario ( ) : boolean | ||
리턴 | boolean | true if current scenario is allowed. |
protected getUploadedFileInstance ( ) : CUploadedFile | ||
리턴 | CUploadedFile |
public saveFile ( ) : void. | ||
리턴 | void. |
public $fileInstanceName |
public $fileName |
protected UploadManager,yupe\components $uploadManager | ||
리턴 | yupe\components\UploadManager |