PHP 클래스 yupe\components\behaviors\FileUploadBehavior

상속: extends CActiveRecordBehavio\CActiveRecordBehavior
파일 보기 프로젝트 열기: yupe/yupe 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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.

메소드 상세

addFileInstanceName() 공개 메소드

public addFileInstanceName ( $name )
$name string the name of the file input field.

attach() 공개 메소드

public attach ( CComponent $owner )
$owner CComponent

beforeDelete() 공개 메소드

public beforeDelete ( CEvent $event )
$event CEvent

beforeSave() 공개 메소드

public beforeSave ( CModelEvent $event ) : boolean
$event CModelEvent
리턴 boolean

beforeValidate() 공개 메소드

public beforeValidate ( CModelEvent $event )
$event CModelEvent

checkScenario() 공개 메소드

Checks whether there is a current scenario in allowed scenarios.
public checkScenario ( ) : boolean
리턴 boolean true if current scenario is allowed.

generateFilename() 공개 메소드

public generateFilename ( ) : string
리턴 string generated file name.

getFilePath() 공개 메소드

public getFilePath ( ) : mixed
리턴 mixed

getFileUrl() 공개 메소드

public getFileUrl ( ) : string
리턴 string url to uploaded file.

getUploadPath() 공개 메소드

public getUploadPath ( ) : string
리턴 string path of the upload directory.

getUploadedFileInstance() 보호된 메소드

protected getUploadedFileInstance ( ) : CUploadedFile
리턴 CUploadedFile

removeFile() 보호된 메소드

Remove previous uploaded file.
protected removeFile ( ) : void.
리턴 void.

saveFile() 공개 메소드

Save new uploaded file to disk and set model attribute.
public saveFile ( ) : void.
리턴 void.

프로퍼티 상세

$attributeName 공개적으로 프로퍼티

attribute to store name of the uploaded file.
public $attributeName

$deleteFileKey 공개적으로 프로퍼티

public string $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.
public $fileInstanceName

$fileName 공개적으로 프로퍼티

callback function to generate filename. Optional. If not set, default implementation will be used.
public $fileName

$maxSize 공개적으로 프로퍼티

maximum file size.
public $maxSize

$minSize 공개적으로 프로퍼티

minimum file size.
public $minSize

$requiredOn 공개적으로 프로퍼티

scenarios when file upload is required.
public $requiredOn

$scenarios 공개적으로 프로퍼티

allowed scenarios when this behavior will be used.
public $scenarios

$types 공개적으로 프로퍼티

allowed file types.
public $types

$uploadManager 보호되어 있는 프로퍼티

protected UploadManager,yupe\components $uploadManager
리턴 yupe\components\UploadManager

$uploadPath 공개적으로 프로퍼티

path of the upload directory.
public $uploadPath