Zend Framework  3.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
FileInput Class Reference

FileInput is a special Input type for handling uploaded files. More...

Public Member Functions

 setAutoPrependUploadValidator ($value)
 
 getAutoPrependUploadValidator ()
 
 getValue ()
 
 isEmptyFile ($rawValue)
 Checks if the raw input value is an empty file input eg: no file was uploaded.
 
 isValid ($context=null)
 
 merge (InputInterface $input)
 
- Public Member Functions inherited from Input
 __construct ($name=null)
 
 setAllowEmpty ($allowEmpty)
 
 setBreakOnFailure ($breakOnFailure)
 
 setContinueIfEmpty ($continueIfEmpty)
 
 setErrorMessage ($errorMessage)
 
 setFilterChain (FilterChain $filterChain)
 
 setName ($name)
 
 setRequired ($required)
 
 setValidatorChain (ValidatorChain $validatorChain)
 
 setValue ($value)
 Set the input value.
 
 resetValue ()
 Reset input value to the default state.
 
 setFallbackValue ($value)
 
 allowEmpty ()
 
 breakOnFailure ()
 
 continueIfEmpty ()
 
 getErrorMessage ()
 
 getFilterChain ()
 
 getName ()
 
 getRawValue ()
 
 isRequired ()
 
 getValidatorChain ()
 
 getValue ()
 
 hasValue ()
 Flag for inform if input value was set.
 
 getFallbackValue ()
 
 hasFallback ()
 
 clearFallbackValue ()
 
 merge (InputInterface $input)
 
 isValid ($context=null)
 
 getMessages ()
 
- Public Member Functions inherited from InputInterface
 isValid ()
 

Protected Member Functions

 injectUploadValidator ()
 
 injectNotEmptyValidator ()
 
- Protected Member Functions inherited from Input
 injectNotEmptyValidator ()
 
 prepareRequiredValidationFailureMessage ()
 Create and return the validation failure message for required input.
 

Protected Attributes

 $isValid = false
 
 $autoPrependUploadValidator = true
 
- Protected Attributes inherited from Input
 $allowEmpty = false
 
 $continueIfEmpty = false
 
 $breakOnFailure = false
 
 $errorMessage
 
 $filterChain
 
 $name
 
 $notEmptyValidator = false
 
 $required = true
 
 $validatorChain
 
 $value
 
 $hasValue = false
 
 $fallbackValue
 
 $hasFallback = false
 

Detailed Description

FileInput is a special Input type for handling uploaded files.

It differs from Input in a few ways:

1. It expects the raw value to be in the $_FILES array format.

2. The validators are run **before** the filters (the opposite behavior of Input). This is so is_uploaded_file() validation can be run prior to any filters that may rename/move/modify the file.

3. Instead of adding a NotEmpty validator, it will (by default) automatically add a Zend validator.

Member Function Documentation

getAutoPrependUploadValidator ( )
Returns
bool
getValue ( )
Returns
mixed

Implements InputInterface.

injectNotEmptyValidator ( )
protected
Deprecated:
2.4.8 See note on parent class. Removal does not affect this class.

No-op, NotEmpty validator does not apply for FileInputs. See also: BaseInputFilter::isValid()

Returns
void
injectUploadValidator ( )
protected
Returns
void
isEmptyFile (   $rawValue)

Checks if the raw input value is an empty file input eg: no file was uploaded.

Parameters
$rawValue
Returns
bool
isValid (   $context = null)
Parameters
mixed$contextExtra "context" to provide the validator
Returns
bool
merge ( InputInterface  $input)
Parameters
InputInterface$input
Returns
FileInput

Implements InputInterface.

setAutoPrependUploadValidator (   $value)
Parameters
bool$valueEnable/Disable automatically prepending an Upload validator
Returns
FileInput

Member Data Documentation

$autoPrependUploadValidator = true
protected
$isValid = false
protected