API Documentation

Form/Element/File.php

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Form  

\Zend_Form_Element_File

Zend_Form_Element

Extends from
\Zend_Form_Element_Xhtml
category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Form  
subpackage
Element  
version
$Id: File.php 23871 2011-04-23 22:40:16Z ramon $  

Constants

Constant  TRANSFER_ADAPTER = 'TRANSFER_ADAPTER'

Plugin loader type

Properties

Propertyprotected\Zend_File_Transfer_Adapter_Abstract  $_adapter= ''

Propertyprotectedinteger  $_counter= '1'

Internal multifile counter
Default value1Details
Type
integer
Propertyprotectedinteger  $_maxFileSize= ''
static

Maximum file size for MAX_FILE_SIZE attribut of form
Details
Type
integer
Propertyprotectedboolean  $_validated= 'false'

Already validated ?
Default valuefalseDetails
Type
boolean
Propertyprotectedboolean  $_valueDisabled= 'false'

Disable value to be equal to file content
Default valuefalseDetails
Type
boolean
Propertypublicstring  $helper= 'formFile'
Default view helper

Default view helper to use

Default valueformFileDetails
Type
string

Methods

methodpublic__call( string $method, array $args ) : string

Overloading: allow rendering specific decorators

Inherited from: \Zend_Form_Element::__call()

Call renderDecoratorName() to render a specific decorator.

Parameters
Name Type Description
$method string
$args array
Returns
Type Description
string
Throws
Exception Description
\Zend_Form_Exception for invalid decorator or invalid method call
methodpublic__construct( string|array|\Zend_Config $spec, array|\Zend_Config $options = null ) : void

Constructor

Inherited from: \Zend_Form_Element::__construct()

$spec may be: - string: name of element - array: options with which to configure element - Zend_Config: Zend_Config with options for configuring element

Parameters
Name Type Description
$spec string|array|\Zend_Config
$options array|\Zend_Config
Throws
Exception Description
\Zend_Form_Exception if no element name after initialization
methodpublic__get( string $key ) : mixed

Overloading: retrieve object property

Inherited from: \Zend_Form_Element::__get()

Prevents access to properties beginning with '_'.

Parameters
Name Type Description
$key string
Returns
Type Description
mixed
methodpublic__set( string $key, mixed $value ) : \voide

Overloading: set object property

Inherited from: \Zend_Form_Element::__set()
Parameters
Name Type Description
$key string
$value mixed
Returns
Type Description
\voide
methodpublic__toString( ) : string

String representation of form element

Inherited from: \Zend_Form_Element::__toString()

Proxies to {@link render()}.

Returns
Type Description
string
methodprivate_convertIniToInteger( string $setting ) : integer

Converts a ini setting to a integer value

Parameters
Name Type Description
$setting string
Returns
Type Description
integer
methodprotected_filterValue( string $value, string $key ) : void

Filter a value

Inherited from: \Zend_Form_Element::_filterValue()
Parameters
Name Type Description
$value string
$key string
methodprotected_getDecorator( string $name, null|array $options ) : \Zend_Form_Decorator_Interface

Instantiate a decorator based on class name or class name fragment

Inherited from: \Zend_Form_Element::_getDecorator()
Parameters
Name Type Description
$name string
$options null|array
Returns
Type Description
\Zend_Form_Decorator_Interface
methodprotected_getErrorMessages( ) : array

Retrieve error messages and perform translation and value substitution

Returns
Type Description
array
methodprotected_hasErrorMessages( ) : bool

Are there custom error messages registered?

Inherited from: \Zend_Form_Element::_hasErrorMessages()
Returns
Type Description
bool
methodprotected_loadDecorator( array $decorator, mixed $name ) : \Zend_Form_Decorator_Interface

Lazy-load a decorator

Inherited from: \Zend_Form_Element::_loadDecorator()
Parameters
Name Type Description
$decorator array Decorator type and options
$name mixed Decorator name or alias
Returns
Type Description
\Zend_Form_Decorator_Interface
methodprotected_loadFilter( array $filter ) : \Zend_Filter_Interface

Lazy-load a filter

Inherited from: \Zend_Form_Element::_loadFilter()
Parameters
Name Type Description
$filter array
Returns
Type Description
\Zend_Filter_Interface
methodprotected_loadValidator( array $validator ) : \Zend_Validate_Interface

Lazy-load a validator

Inherited from: \Zend_Form_Element::_loadValidator()
Parameters
Name Type Description
$validator array Validator definition
Returns
Type Description
\Zend_Validate_Interface
methodpublicaddDecorator( string|\Zend_Form_Decorator_Interface $decorator, array|\Zend_Config $options = null ) : \Zend_Form_Element

Add a decorator for rendering the element

Inherited from: \Zend_Form_Element::addDecorator()
Parameters
Name Type Description
$decorator string|\Zend_Form_Decorator_Interface
$options array|\Zend_Config Options with which to initialize decorator
Returns
Type Description
\Zend_Form_Element
methodpublicaddDecorators( array $decorators ) : \Zend_Form_Element

Add many decorators at once

Inherited from: \Zend_Form_Element::addDecorators()
Parameters
Name Type Description
$decorators array
Returns
Type Description
\Zend_Form_Element
methodpublicaddError( string $message ) : \Zend_Form_Element

Add an error message and mark element as failed validation

Inherited from: \Zend_Form_Element::addError()
Parameters
Name Type Description
$message string
Returns
Type Description
\Zend_Form_Element
methodpublicaddErrorMessage( string $message ) : \Zend_Form_Element

Add a custom error message to return in the event of failed validation

Inherited from: \Zend_Form_Element::addErrorMessage()
Parameters
Name Type Description
$message string
Returns
Type Description
\Zend_Form_Element
methodpublicaddErrorMessages( array $messages ) : \Zend_Form_Element

Add multiple custom error messages to return in the event of failed validation

Inherited from: \Zend_Form_Element::addErrorMessages()
Parameters
Name Type Description
$messages array
Returns
Type Description
\Zend_Form_Element
methodpublicaddErrors( array $messages ) : \Zend_Form_Element

Add multiple error messages and flag element as failed validation

Inherited from: \Zend_Form_Element::addErrors()
Parameters
Name Type Description
$messages array
Returns
Type Description
\Zend_Form_Element
methodpublicaddFilter( string|array $filter, string|array $options = null ) : \Zend_Form_Element_File

Add Filter; proxy to adapter

Parameters
Name Type Description
$filter string|array Type of filter to add
$options string|array Options to set for the filter
Returns
Type Description
\Zend_Form_Element_File
methodpublicaddFilters( array $filters ) : \Zend_Form_Element_File

Add Multiple filters at once; proxy to adapter

Parameters
Name Type Description
$filters array
Returns
Type Description
\Zend_Form_Element_File
methodpublicaddPrefixPath( string $prefix, string $path, string $type = null ) : \Zend_Form_Element_File

Add prefix path for plugin loader

If no $type specified, assumes it is a base path for both filters and validators, and sets each according to the following rules: - decorators: $prefix = $prefix . '_Decorator' - filters: $prefix = $prefix . '_Filter' - validators: $prefix = $prefix . '_Validate'

Otherwise, the path prefix is set on the appropriate plugin loader.

Parameters
Name Type Description
$prefix string
$path string
$type string
Returns
Type Description
\Zend_Form_Element_File
Throws
Exception Description
\Zend_Form_Exception for invalid type
methodpublicaddPrefixPaths( array $spec ) : \Zend_Form_Element

Add many prefix paths at once

Inherited from: \Zend_Form_Element::addPrefixPaths()
Parameters
Name Type Description
$spec array
Returns
Type Description
\Zend_Form_Element
methodpublicaddValidator( string|\Zend_Validate_Interface $validator, bool $breakChainOnFailure = false, mixed $options = array ) : \Zend_Form_Element_File

Add Validator; proxy to adapter

Note: will overwrite existing validators if they are of the same class.

Parameters
Name Type Description
$validator string|\Zend_Validate_Interface
$breakChainOnFailure bool
$options mixed
Returns
Type Description
\Zend_Form_Element_File
Throws
Exception Description
\Zend_Form_Exception if invalid validator type
methodpublicaddValidators( array $validators ) : \Zend_Form_Element_File

Add multiple validators at once; proxy to adapter

Parameters
Name Type Description
$validators array
Returns
Type Description
\Zend_Form_Element_File
methodpublicautoInsertNotEmptyValidator( ) : bool

Get flag indicating whether a NotEmpty validator should be inserted when element is required

Inherited from: \Zend_Form_Element::autoInsertNotEmptyValidator()
Returns
Type Description
bool
methodpublicclearDecorators( ) : \Zend_Form_Element

Clear all decorators

Inherited from: \Zend_Form_Element::clearDecorators()
Returns
Type Description
\Zend_Form_Element
methodpublicclearErrorMessages( ) : \Zend_Form_Element

Clear custom error messages stack

Inherited from: \Zend_Form_Element::clearErrorMessages()
Returns
Type Description
\Zend_Form_Element
methodpublicclearFilters( ) : \Zend_Form_Element_File

Remove all filters; proxy to adapter

Returns
Type Description
\Zend_Form_Element_File
methodpublicclearValidators( ) : \Zend_Form_Element_File

Remove all validators; proxy to adapter

Returns
Type Description
\Zend_Form_Element_File
methodpublicfilterName( string $value, bool $allowBrackets = false ) : string

Filter a name to only allow valid variable characters

Inherited from: \Zend_Form_Element::filterName()
Parameters
Name Type Description
$value string
$allowBrackets bool
Returns
Type Description
string
methodpublicgetAllowEmpty( ) : bool

Get 'allow empty' flag

Inherited from: \Zend_Form_Element::getAllowEmpty()
Returns
Type Description
bool
methodpublicgetAttrib( string $name ) : string

Retrieve element attribute

Inherited from: \Zend_Form_Element::getAttrib()
Parameters
Name Type Description
$name string
Returns
Type Description
string
methodpublicgetAttribs( ) : array

Return all attributes

Inherited from: \Zend_Form_Element::getAttribs()
Returns
Type Description
array
methodpublicgetBelongsTo( ) : string

Return array name to which element belongs

Inherited from: \Zend_Form_Element::getBelongsTo()
Returns
Type Description
string
methodpublicgetDecorator( string $name ) : false|\Zend_Form_Decorator_Abstract

Retrieve a registered decorator

Inherited from: \Zend_Form_Element::getDecorator()
Parameters
Name Type Description
$name string
Returns
Type Description
false\Zend_Form_Decorator_Abstract
methodpublicgetDecorators( ) : array

Retrieve all decorators

Inherited from: \Zend_Form_Element::getDecorators()
Returns
Type Description
array
methodpublicgetDescription( ) : string

Retrieve element description

Inherited from: \Zend_Form_Element::getDescription()
Returns
Type Description
string
methodpublicgetDestination( ) : string

Get the upload destination

Returns
Type Description
string
methodpublicgetErrorMessageSeparator( ) : string

Get errorMessageSeparator

Inherited from: \Zend_Form_Element::getErrorMessageSeparator()
Returns
Type Description
string
methodpublicgetErrorMessages( ) : array

Retrieve custom error messages

Inherited from: \Zend_Form_Element::getErrorMessages()
Returns
Type Description
array
methodpublicgetErrors( ) : array

Retrieve error codes; proxy to transfer adapter

Returns
Type Description
array
methodpublicgetFileInfo( string $value = null ) : array

Get internal file informations

Parameters
Name Type Description
$value string

(Optional) Element or file to return

Returns
Type Description
array
methodpublicgetFileName( string $value = null, boolean $path = true ) : string

Get the final filename

Parameters
Name Type Description
$value string

(Optional) Element or file to return

$path boolean

(Optional) Return also the path, defaults to true

Returns
Type Description
string
methodpublicgetFileSize( ) : string|array

Returns the filesize for this file element

Returns
Type Description
stringarray Filesize
methodpublicgetFilter( string $name ) : \Zend_Filter_Interface|null

Retrieve individual filter; proxy to adapter

Parameters
Name Type Description
$name string
Returns
Type Description
\Zend_Filter_Interfacenull
methodpublicgetFilters( ) : array

Returns all set filters; proxy to adapter

Returns
Type Description
array List of set filters
methodpublicgetFullyQualifiedName( ) : string

Get fully qualified name

Inherited from: \Zend_Form_Element::getFullyQualifiedName()

Places name as subitem of array and/or appends brackets.

Returns
Type Description
string
methodpublicgetHash( string $hash = crc32 ) : string|array

Returns the hash for this file element

Parameters
Name Type Description
$hash string

(Optional) Hash algorithm to use

Returns
Type Description
stringarray Hashstring
methodpublicgetId( ) : string

Get element id

Inherited from: \Zend_Form_Element::getId()
Returns
Type Description
string
methodpublicgetIgnore( ) : bool

Get ignore flag (used when retrieving values at form level)

Inherited from: \Zend_Form_Element::getIgnore()
Returns
Type Description
bool
methodpublicgetLabel( ) : string

Retrieve element label

Inherited from: \Zend_Form_Element::getLabel()
Returns
Type Description
string
methodpublicgetMaxFileSize( ) : integer

Sets the maximum file size of the form

Returns
Type Description
integer
methodpublicgetMessages( ) : array

Retrieve error messages; proxy to transfer adapter

If isValid() was never called or if the most recent isValid() call returned true, then this method returns an empty array.

Returns
Type Description
array
methodpublicgetMimeType( ) : string|array

Returns the mimetype for this file element

Returns
Type Description
stringarray Mimetype
methodpublicgetMultiFile( ) : integer

Returns the multifile element number

Returns
Type Description
integer
methodpublicgetName( ) : string

Return element name

Inherited from: \Zend_Form_Element::getName()
Returns
Type Description
string
methodpublicgetOrder( ) : int

Retrieve element order

Inherited from: \Zend_Form_Element::getOrder()
Returns
Type Description
int
methodpublicgetPluginLoader( string $type ) : \Zend_Loader_PluginLoader_Interface

Get Plugin Loader

Instantiates with default rules if none available for that type. Use 'decorator', 'filter', or 'validate' for $type.

Parameters
Name Type Description
$type string
Returns
Type Description
\Zend_Loader_PluginLoader_Interface
Throws
Exception Description
\Zend_Loader_Exception on invalid type.
methodpublicgetTransferAdapter( ) : \Zend_File_Transfer_Adapter_Abstract

Get transfer adapter

Lazy loads HTTP transfer adapter when no adapter registered.

Returns
Type Description
\Zend_File_Transfer_Adapter_Abstract
methodpublicgetTranslator( ) : \Zend_Translate_Adapter|null

Retrieve localization translator object

Returns
Type Description
\Zend_Translate_Adapternull
methodpublicgetType( ) : string

Return element type

Inherited from: \Zend_Form_Element::getType()
Returns
Type Description
string
methodpublicgetUnfilteredValue( ) : mixed

Retrieve unfiltered element value

Inherited from: \Zend_Form_Element::getUnfilteredValue()
Returns
Type Description
mixed
methodpublicgetValidator( string $name ) : \Zend_Validate_Interface|null

Retrieve validator by name; proxy to adapter

Parameters
Name Type Description
$name string
Returns
Type Description
\Zend_Validate_Interfacenull
methodpublicgetValidators( ) : array

Retrieve all validators; proxy to adapter

Returns
Type Description
array
methodpublicgetValue( ) : null|string

Processes the file, returns null or the filename only For the complete path, use getFileName

Returns
Type Description
nullstring
methodpublicgetView( ) : null|\Zend_View_Interface

Retrieve view object

Inherited from: \Zend_Form_Element::getView()

Retrieves from ViewRenderer if none previously set.

Returns
Type Description
null\Zend_View_Interface
methodpublichasErrors( ) : bool

Are there errors registered?

Returns
Type Description
bool
methodpublichasTranslator( ) : bool

Does this element have its own specific translator?

Inherited from: \Zend_Form_Element::hasTranslator()
Returns
Type Description
bool
methodpublicinit( ) : void

Initialize object; used by extending classes

Inherited from: \Zend_Form_Element::init()
methodpublicisArray( ) : bool

Is the element representing an array?

Inherited from: \Zend_Form_Element::isArray()
Returns
Type Description
bool
methodpublicisFiltered( ) : bool

Has the file been filtered?

Returns
Type Description
bool
methodpublicisReceived( ) : bool

Was the file received?

Returns
Type Description
bool
methodpublicisRequired( ) : bool

Is the element required?

Inherited from: \Zend_Form_Element::isRequired()
Returns
Type Description
bool
methodpublicisUploaded( ) : bool

Was the file uploaded?

Returns
Type Description
bool
methodpublicisValid( string $value, mixed $context = null ) : bool

Validate upload

If a translation adapter is registered, any error messages will be translated according to the current locale, using the given error code; if no matching translation is found, the original message will be utilized.

Note: The filtered value is validated.

Parameters
Name Type Description
$value string File, can be optional, give null to validate all files
$context mixed
Returns
Type Description
bool
Throws
Exception Description
\Zend_Validate_Exception If validation of $value is impossible
methodpublicisValueDisabled( ) : boolean

Returns if the file will be uploaded when calling getValues()

Returns
Type Description
boolean Receive the file on calling getValues()?
methodpublicloadDefaultDecorators( ) : \Zend_Form_Element_File

Load default decorators

Returns
Type Description
\Zend_Form_Element_File
methodpublicloadDefaultDecoratorsIsDisabled( ) : bool

Should we load the default decorators?

Inherited from: \Zend_Form_Element::loadDefaultDecoratorsIsDisabled()
Returns
Type Description
bool
methodpublicmarkAsError( ) : \Zend_Form_Element

Mark the element as being in a failed validation state

Inherited from: \Zend_Form_Element::markAsError()
Returns
Type Description
\Zend_Form_Element
methodpublicreceive( ) : boolean

Receive the uploaded file

Returns
Type Description
boolean
methodpublicremoveDecorator( string $name ) : \Zend_Form_Element

Remove a single decorator

Inherited from: \Zend_Form_Element::removeDecorator()
Parameters
Name Type Description
$name string
Returns
Type Description
\Zend_Form_Element
methodpublicremoveFilter( string $name ) : \Zend_Form_Element_File

Remove an individual filter; proxy to adapter

Parameters
Name Type Description
$name string
Returns
Type Description
\Zend_Form_Element_File
methodpublicremoveValidator( string $name ) : \Zend_Form_Element_File

Remove validator by name; proxy to adapter

Parameters
Name Type Description
$name string
Returns
Type Description
\Zend_Form_Element_File
methodpublicrender( \Zend_View_Interface $view = null ) : string

Render form element Checks for decorator interface to prevent errors

Parameters
Name Type Description
$view \Zend_View_Interface
Returns
Type Description
string
methodpublicresolveElementId( \Zend_Form_Decorator_Interface $decorator ) : string
static

Used to resolve and return an element ID

Inherited from: \Zend_Form_Element::resolveElementId()

Passed to the HtmlTag decorator as a callback in order to provide an ID.

Parameters
Name Type Description
$decorator \Zend_Form_Decorator_Interface
Returns
Type Description
string
methodpublicsetAllowEmpty( bool $flag ) : \Zend_Form_Element

Set 'allow empty' flag

Inherited from: \Zend_Form_Element::setAllowEmpty()

When the allow empty flag is enabled and the required flag is false, the element will validate with empty values.

Parameters
Name Type Description
$flag bool
Returns
Type Description
\Zend_Form_Element
methodpublicsetAttrib( string $name, mixed $value ) : \Zend_Form_Element

Set element attribute

Inherited from: \Zend_Form_Element::setAttrib()
Parameters
Name Type Description
$name string
$value mixed
Returns
Type Description
\Zend_Form_Element
Throws
Exception Description
\Zend_Form_Exception for invalid $name values
methodpublicsetAttribs( array $attribs ) : \Zend_Form_Element

Set multiple attributes at once

Inherited from: \Zend_Form_Element::setAttribs()
Parameters
Name Type Description
$attribs array
Returns
Type Description
\Zend_Form_Element
methodpublicsetAutoInsertNotEmptyValidator( bool $flag ) : \Zend_Form_Element

Set flag indicating whether a NotEmpty validator should be inserted when element is required

Inherited from: \Zend_Form_Element::setAutoInsertNotEmptyValidator()
Parameters
Name Type Description
$flag bool
Returns
Type Description
\Zend_Form_Element
methodpublicsetBelongsTo( string $array ) : \Zend_Form_Element

Set array to which element belongs

Inherited from: \Zend_Form_Element::setBelongsTo()
Parameters
Name Type Description
$array string
Returns
Type Description
\Zend_Form_Element
methodpublicsetConfig( \Zend_Config $config ) : \Zend_Form_Element

Set object state from Zend_Config object

Inherited from: \Zend_Form_Element::setConfig()
Parameters
Name Type Description
$config \Zend_Config
Returns
Type Description
\Zend_Form_Element
methodpublicsetDecorators( array $decorators ) : \Zend_Form_Element

Overwrite all decorators

Inherited from: \Zend_Form_Element::setDecorators()
Parameters
Name Type Description
$decorators array
Returns
Type Description
\Zend_Form_Element
methodpublicsetDescription( string $description ) : \Zend_Form_Element

Set element description

Inherited from: \Zend_Form_Element::setDescription()
Parameters
Name Type Description
$description string
Returns
Type Description
\Zend_Form_Element
methodpublicsetDestination( string $path ) : \Zend_Form_Element_File

Set the upload destination

Parameters
Name Type Description
$path string
Returns
Type Description
\Zend_Form_Element_File
methodpublicsetDisableLoadDefaultDecorators( bool $flag ) : \Zend_Form_Element

Set flag to disable loading default decorators

Inherited from: \Zend_Form_Element::setDisableLoadDefaultDecorators()
Parameters
Name Type Description
$flag bool
Returns
Type Description
\Zend_Form_Element
methodpublicsetDisableTranslator( bool $flag ) : \Zend_Form_Element_File

Indicate whether or not translation should be disabled

Parameters
Name Type Description
$flag bool
Returns
Type Description
\Zend_Form_Element_File
methodpublicsetErrorMessageSeparator( string $separator ) : \Zend_Form_Element

Set errorMessageSeparator

Inherited from: \Zend_Form_Element::setErrorMessageSeparator()
Parameters
Name Type Description
$separator string
Returns
Type Description
\Zend_Form_Element
methodpublicsetErrorMessages( array $messages ) : \Zend_Form_Element

Same as addErrorMessages(), but clears custom error message stack first

Inherited from: \Zend_Form_Element::setErrorMessages()
Parameters
Name Type Description
$messages array
Returns
Type Description
\Zend_Form_Element
methodpublicsetErrors( array $messages ) : \Zend_Form_Element

Overwrite any previously set error messages and flag as failed validation

Inherited from: \Zend_Form_Element::setErrors()
Parameters
Name Type Description
$messages array
Returns
Type Description
\Zend_Form_Element
methodpublicsetFilters(  $filters ) : \Zend_Form_Element_File

Sets a filter for the class, erasing all previous set; proxy to adapter

Parameters
Name Type Description
$filters
Returns
Type Description
\Zend_Form_Element_File
methodpublicsetIgnore( bool $flag ) : \Zend_Form_Element

Set ignore flag (used when retrieving values at form level)

Inherited from: \Zend_Form_Element::setIgnore()
Parameters
Name Type Description
$flag bool
Returns
Type Description
\Zend_Form_Element
methodpublicsetIsArray( bool $flag ) : \Zend_Form_Element

Set flag indicating if element represents an array

Inherited from: \Zend_Form_Element::setIsArray()
Parameters
Name Type Description
$flag bool
Returns
Type Description
\Zend_Form_Element
methodpublicsetLabel( string $label ) : \Zend_Form_Element

Set element label

Inherited from: \Zend_Form_Element::setLabel()
Parameters
Name Type Description
$label string
Returns
Type Description
\Zend_Form_Element
methodpublicsetMaxFileSize( integer $size ) : integer

Sets the maximum file size of the form

Parameters
Name Type Description
$size integer
Returns
Type Description
integer
methodpublicsetMultiFile( integer $count ) : \Zend_Form_Element_File

Set a multifile element

Parameters
Name Type Description
$count integer Number of file elements
Returns
Type Description
\Zend_Form_Element_File Provides fluent interface
methodpublicsetName( string $name ) : \Zend_Form_Element

Set element name

Inherited from: \Zend_Form_Element::setName()
Parameters
Name Type Description
$name string
Returns
Type Description
\Zend_Form_Element
methodpublicsetOptions( array $options ) : \Zend_Form_Element

Set object state from options array

Inherited from: \Zend_Form_Element::setOptions()
Parameters
Name Type Description
$options array
Returns
Type Description
\Zend_Form_Element
methodpublicsetOrder( int $order ) : \Zend_Form_Element

Set element order

Inherited from: \Zend_Form_Element::setOrder()
Parameters
Name Type Description
$order int
Returns
Type Description
\Zend_Form_Element
methodpublicsetPluginLoader( \Zend_Loader_PluginLoader_Interface $loader, string $type ) : \Zend_Form_Element_File

Set plugin loader

Parameters
Name Type Description
$loader \Zend_Loader_PluginLoader_Interface
$type string
Returns
Type Description
\Zend_Form_Element_File
Throws
Exception Description
\Zend_Form_Exception on invalid type
methodpublicsetRequired( bool $flag = true ) : \Zend_Form_Element

Set required flag

Inherited from: \Zend_Form_Element::setRequired()
Parameters
Name Type Description
$flag bool Default value is true
Returns
Type Description
\Zend_Form_Element
methodpublicsetTransferAdapter( string|\Zend_File_Transfer_Adapter_Abstract $adapter ) : \Zend_Form_Element_File

Set transfer adapter

Parameters
Name Type Description
$adapter string|\Zend_File_Transfer_Adapter_Abstract
Returns
Type Description
\Zend_Form_Element_File
methodpublicsetTranslator( \Zend_Translate|null $translator = null ) : \Zend_Form_Element_File

Set translator object for localization

Parameters
Name Type Description
$translator \Zend_Translate|null
Returns
Type Description
\Zend_Form_Element_File
methodpublicsetValidators( array $validators ) : \Zend_Form_Element_File

Add multiple validators at once, overwriting; proxy to adapter

Parameters
Name Type Description
$validators array
Returns
Type Description
\Zend_Form_Element_File
methodpublicsetValue( mixed $value ) : \Zend_Form_Element_File

Disallow setting the value

Parameters
Name Type Description
$value mixed
Returns
Type Description
\Zend_Form_Element_File
methodpublicsetValueDisabled( 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()

Parameters
Name Type Description
$flag boolean Sets if the file is handled as the elements value
Returns
Type Description
\Zend_Form_Element_File
methodpublicsetView( \Zend_View_Interface $view = null ) : \Zend_Form_Element

Set view object

Inherited from: \Zend_Form_Element::setView()
Parameters
Name Type Description
$view \Zend_View_Interface
Returns
Type Description
\Zend_Form_Element
methodpublictranslatorIsDisabled( ) : bool

Is translation disabled?

Returns
Type Description
bool
Documentation was generated by DocBlox 0.13.3.