Свойство | 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. |
Свойство | Type | Description | |
---|---|---|---|
$uploadManager | yupe\components\UploadManager |
Méthode | 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. |
Méthode | 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 | |
Résultat | boolean |
public checkScenario ( ) : boolean | ||
Résultat | boolean | true if current scenario is allowed. |
public generateFilename ( ) : string | ||
Résultat | string | generated file name. |
public getUploadPath ( ) : string | ||
Résultat | string | path of the upload directory. |
protected getUploadedFileInstance ( ) : CUploadedFile | ||
Résultat | CUploadedFile |
protected removeFile ( ) : void. | ||
Résultat | void. |
public saveFile ( ) : void. | ||
Résultat | void. |
public $attributeName |
public $fileInstanceName |
public $fileName |
protected UploadManager,yupe\components $uploadManager | ||
Résultat | yupe\components\UploadManager |