PHP Class Form_Field_Upload, atk4

- flash upload. Upload will be carried through by flash. Mode can be set by setMode('plain') - plain mode is not available with AJAX form setMode('iframe') setMode('flash') by Default mode is iframe. allowMultiple(boolean=true) this function will allow you to specify whether you want user to upload multiple files. by default, single mode is used Mode Support. You can use setModel('filestore/File'); This will use the model for file upload handling. You can specify your own model, which derives from either filestore\Model_File or filestore\Model_Image Field value will always contain "id" of uploaded file. If multiple file upload is permitted, field will contain comma-separated list of IDs. Example1: Simple use with model $upl=$form->addField('Upload','myfile_id') ->setModel('filestore/File'); Example2: Customizing field $upl=$form->addField('Upload','photo_id','Photo') ->setController('filestore/Image') ->allowMultiple(false); $upl->template->set('after_field','Max size: 500k'); Example3: Specifying inside Model $model=$this->add('Model_Book'); $model->add('filestore/Field_Image','picture_id'); $this->add('Form')->setModel($model); Example4: Use of your custom model
Inheritance: extends Form_Field
ファイルを表示 Open project: atk4/atk4

Public Properties

Property Type Description
$debug boolean
$format_files_template string
$max_file_size integer | null
$mode string
$multiple integer | false

Public Methods

Method Description
allowMultiple ( $multiple = 50 )
convertToBytes ( $val )
debug ( )
displayUploadInfo ( )
formatFiles ( $data )
getFile ( )
getFileError ( )
getFilePath ( )
getFileSize ( )
getFilesizeFieldName ( )
getInput ( )
getOriginalFilenameFieldName ( )
getOriginalName ( )
getOriginalType ( )
getTypeIDFieldName ( )
getUploadedFiles ( ) those can be done in flash thingie as well
getVolumeIDFieldName ( ) * reimplement these functions in your *_Upload class
init ( )
isUploaded ( )
loadPOST ( )
saveInto ( $directory )
setFormatFilesTemplate ( $template )
setMode ( $mode )
uploadComplete ( $data = null )
uploadFailed ( $message )

Method Details

allowMultiple() public method

public allowMultiple ( $multiple = 50 )

convertToBytes() public method

public convertToBytes ( $val )

debug() public method

public debug ( )

displayUploadInfo() public method

public displayUploadInfo ( )

formatFiles() public method

public formatFiles ( $data )

getFile() public method

public getFile ( )

getFileError() public method

public getFileError ( )

getFilePath() public method

public getFilePath ( )

getFileSize() public method

public getFileSize ( )

getFilesizeFieldName() public method

getInput() public method

public getInput ( )

getOriginalFilenameFieldName() public method

getOriginalName() public method

public getOriginalName ( )

getOriginalType() public method

public getOriginalType ( )

getTypeIDFieldName() public method

public getTypeIDFieldName ( )

getUploadedFiles() public method

those can be done in flash thingie as well
public getUploadedFiles ( )

getVolumeIDFieldName() public method

* reimplement these functions in your *_Upload class

init() public method

public init ( )

isUploaded() public method

public isUploaded ( )

loadPOST() public method

public loadPOST ( )

saveInto() public method

public saveInto ( $directory )

setFormatFilesTemplate() public method

public setFormatFilesTemplate ( $template )

setMode() public method

public setMode ( $mode )

uploadComplete() public method

public uploadComplete ( $data = null )

uploadFailed() public method

public uploadFailed ( $message )

Property Details

$debug public_oe property

public bool $debug
return boolean

$format_files_template public_oe property

public string $format_files_template
return string

$max_file_size public_oe property

public int|null $max_file_size
return integer | null

$mode public_oe property

public string $mode
return string

$multiple public_oe property

public int|false $multiple
return integer | false