Form/Element/File.php
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Form
\Zend_Form_Element_File
- Parent(s)
- \Zend_Form_Element_Xhtml < \Zend_Form_Element
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Version
- $Id$
Constants
Properties
integer $_maxFileSize = -1
Maximum file size for MAX_FILE_SIZE attribut of form
-1
Details- Type
- integer
boolean $_valueDisabled = false
Disable value to be equal to file content
false
Details- Type
- boolean
Methods
_convertIniToInteger(string $setting) : integer
Converts a ini setting to a integer value
Name | Type | Description |
---|---|---|
$setting | string |
Type | Description |
---|---|
integer |
_getErrorMessages() : array
Retrieve error messages and perform translation and value substitution
Type | Description |
---|---|
array |
addFilter(string | array $filter, string | array $options = null) : \Zend_Form_Element_File
Add Filter; proxy to adapter
Name | Type | Description |
---|---|---|
$filter | string | array | Type of filter to add |
$options | string | array | Options to set for the filter |
Type | Description |
---|---|
\Zend_Form_Element_File |
addFilters(array $filters) : \Zend_Form_Element_File
Add Multiple filters at once; proxy to adapter
Name | Type | Description |
---|---|---|
$filters | array |
Type | Description |
---|---|
\Zend_Form_Element_File |
addPrefixPath(string $prefix, string $path, string $type = null) : \Zend_Form_Element_File
Add prefix path for plugin loader
Name | Type | Description |
---|---|---|
$prefix | string | |
$path | string | |
$type | string |
Type | Description |
---|---|
\Zend_Form_Element_File |
addValidator(string | \Zend_Validate_Interface $validator, bool $breakChainOnFailure = false, mixed $options = array()) : \Zend_Form_Element_File
Add Validator; proxy to adapter
Name | Type | Description |
---|---|---|
$validator | string | \Zend_Validate_Interface | |
$breakChainOnFailure | bool | |
$options | mixed |
Type | Description |
---|---|
\Zend_Form_Element_File |
addValidators(array $validators) : \Zend_Form_Element_File
Add multiple validators at once; proxy to adapter
Name | Type | Description |
---|---|---|
$validators | array |
Type | Description |
---|---|
\Zend_Form_Element_File |
clearFilters() : \Zend_Form_Element_File
Remove all filters; proxy to adapter
Type | Description |
---|---|
\Zend_Form_Element_File |
clearValidators() : \Zend_Form_Element_File
Remove all validators; proxy to adapter
Type | Description |
---|---|
\Zend_Form_Element_File |
getFileInfo(string $value = null) : array
Get internal file informations
Name | Type | Description |
---|---|---|
$value | string | (Optional) Element or file to return |
Type | Description |
---|---|
array |
getFileName(string $value = null, boolean $path = true) : string
Get the final filename
Name | Type | Description |
---|---|---|
$value | string | (Optional) Element or file to return |
$path | boolean | (Optional) Return also the path, defaults to true |
Type | Description |
---|---|
string |
getFileSize() : string | array
Returns the filesize for this file element
Type | Description |
---|---|
string | array | Filesize |
getFilter(string $name) : \Zend_Filter_Interface | null
Retrieve individual filter; proxy to adapter
Name | Type | Description |
---|---|---|
$name | string |
Type | Description |
---|---|
\Zend_Filter_Interface | null |
getFilters() : array
Returns all set filters; proxy to adapter
Type | Description |
---|---|
array | List of set filters |
getHash(string $hash = 'crc32') : string | array
Returns the hash for this file element
Name | Type | Description |
---|---|---|
$hash | string | (Optional) Hash algorithm to use |
Type | Description |
---|---|
string | array | Hashstring |
getMimeType() : string | array
Returns the mimetype for this file element
Type | Description |
---|---|
string | array | Mimetype |
getPluginLoader(string $type) : \Zend_Loader_PluginLoader_Interface
Get Plugin Loader
Name | Type | Description |
---|---|---|
$type | string |
Type | Description |
---|---|
\Zend_Loader_PluginLoader_Interface |
getTransferAdapter() : \Zend_File_Transfer_Adapter_Abstract
Get transfer adapter
Type | Description |
---|---|
\Zend_File_Transfer_Adapter_Abstract |
getTranslator() : \Zend_Translate_Adapter | null
Retrieve localization translator object
Type | Description |
---|---|
\Zend_Translate_Adapter | null |
getValidator(string $name) : \Zend_Validate_Interface | null
Retrieve validator by name; proxy to adapter
Name | Type | Description |
---|---|---|
$name | string |
Type | Description |
---|---|
\Zend_Validate_Interface | null |
getValue() : null | string
Processes the file, returns null or the filename only For the complete path, use getFileName
Type | Description |
---|---|
null | string |
isValid(string $value, mixed $context = null) : bool
Validate upload
Name | Type | Description |
---|---|---|
$value | string | File, can be optional, give null to validate all files |
$context | mixed |
Type | Description |
---|---|
bool |
isValueDisabled() : boolean
Returns if the file will be uploaded when calling getValues()
Type | Description |
---|---|
boolean | Receive the file on calling getValues()? |
loadDefaultDecorators() : \Zend_Form_Element_File
Load default decorators
Type | Description |
---|---|
\Zend_Form_Element_File |
removeFilter(string $name) : \Zend_Form_Element_File
Remove an individual filter; proxy to adapter
Name | Type | Description |
---|---|---|
$name | string |
Type | Description |
---|---|
\Zend_Form_Element_File |
removeValidator(string $name) : \Zend_Form_Element_File
Remove validator by name; proxy to adapter
Name | Type | Description |
---|---|---|
$name | string |
Type | Description |
---|---|
\Zend_Form_Element_File |
render(\Zend_View_Interface $view = null) : string
Render form element Checks for decorator interface to prevent errors
Name | Type | Description |
---|---|---|
$view | \Zend_View_Interface |
Type | Description |
---|---|
string |
Exception | Description |
---|---|
\Zend_Form_Element_Exception |
setDestination(string $path) : \Zend_Form_Element_File
Set the upload destination
Name | Type | Description |
---|---|---|
$path | string |
Type | Description |
---|---|
\Zend_Form_Element_File |
setDisableTranslator(bool $flag) : \Zend_Form_Element_File
Indicate whether or not translation should be disabled
Name | Type | Description |
---|---|---|
$flag | bool |
Type | Description |
---|---|
\Zend_Form_Element_File |
setFilters(array $filters) : \Zend_Form_Element_File
Sets a filter for the class, erasing all previous set; proxy to adapter
Name | Type | Description |
---|---|---|
$filters | array | Filters to set |
Type | Description |
---|---|
\Zend_Form_Element_File |
setMaxFileSize(integer $size) : integer
Sets the maximum file size of the form
Name | Type | Description |
---|---|---|
$size | integer |
Type | Description |
---|---|
integer |
setMultiFile(integer $count) : \Zend_Form_Element_File
Set a multifile element
Name | Type | Description |
---|---|---|
$count | integer | Number of file elements |
Type | Description |
---|---|
\Zend_Form_Element_File | Provides fluent interface |
setPluginLoader(\Zend_Loader_PluginLoader_Interface $loader, string $type) : \Zend_Form_Element_File
Set plugin loader
Name | Type | Description |
---|---|---|
$loader | \Zend_Loader_PluginLoader_Interface | |
$type | string |
Type | Description |
---|---|
\Zend_Form_Element_File |
setTransferAdapter(string | \Zend_File_Transfer_Adapter_Abstract $adapter) : \Zend_Form_Element_File
Set transfer adapter
Name | Type | Description |
---|---|---|
$adapter | string | \Zend_File_Transfer_Adapter_Abstract |
Type | Description |
---|---|
\Zend_Form_Element_File |
Exception | Description |
---|---|
\Zend_Form_Element_Exception |
setTranslator(\Zend_Translate | null $translator = null) : \Zend_Form_Element_File
Set translator object for localization
Name | Type | Description |
---|---|---|
$translator | \Zend_Translate | null |
Type | Description |
---|---|
\Zend_Form_Element_File |
setValidators(array $validators) : \Zend_Form_Element_File
Add multiple validators at once, overwriting; proxy to adapter
Name | Type | Description |
---|---|---|
$validators | array |
Type | Description |
---|---|
\Zend_Form_Element_File |
setValue(mixed $value) : \Zend_Form_Element_File
Disallow setting the value
Name | Type | Description |
---|---|---|
$value | mixed |
Type | Description |
---|---|
\Zend_Form_Element_File |
setValueDisabled(boolean $flag) : \Zend_Form_Element_File
Set if the file will be uploaded when getting the value This defaults to false which will force receive() when calling getValues()
Name | Type | Description |
---|---|---|
$flag | boolean | Sets if the file is handled as the elements value |
Type | Description |
---|---|
\Zend_Form_Element_File |