Documentation

FileFormField extends FormField
in package

FileFormField represents a file form field (an HTML file input tag).

Tags
author

Fabien Potencier fabien@symfony.com

Table of Contents

$disabled  : bool
$document  : DOMDocument
$name  : string
$node  : DOMElement
$value  : string
$xpath  : DOMXPath
__construct()  : mixed
getLabel()  : DOMElement|null
Returns the label tag associated to the field or null if none.
getName()  : string
Returns the name of the field.
getValue()  : string|array<string|int, mixed>
Gets the value of the field.
hasValue()  : bool
Returns true if the field should be included in the submitted values.
isDisabled()  : bool
Check if the current field is disabled.
setErrorCode()  : mixed
Sets the PHP error code associated with the field.
setFilePath()  : mixed
Sets path to the file as string for simulating HTTP request.
setValue()  : mixed
Sets the value of the field.
upload()  : mixed
Sets the value of the field.
initialize()  : mixed
Initializes the form field.

Properties

Methods

__construct()

public __construct(DOMElement $node) : mixed
Parameters
$node : DOMElement

The node associated with this field

Return values
mixed

getLabel()

Returns the label tag associated to the field or null if none.

public getLabel() : DOMElement|null
Return values
DOMElement|null

getName()

Returns the name of the field.

public getName() : string
Return values
string

The name of the field

getValue()

Gets the value of the field.

public getValue() : string|array<string|int, mixed>
Return values
string|array<string|int, mixed>

The value of the field

hasValue()

Returns true if the field should be included in the submitted values.

public hasValue() : bool
Return values
bool

true if the field should be included in the submitted values, false otherwise

isDisabled()

Check if the current field is disabled.

public isDisabled() : bool
Return values
bool

setErrorCode()

Sets the PHP error code associated with the field.

public setErrorCode(int $error) : mixed
Parameters
$error : int

The error code (one of UPLOAD_ERR_INI_SIZE, UPLOAD_ERR_FORM_SIZE, UPLOAD_ERR_PARTIAL, UPLOAD_ERR_NO_FILE, UPLOAD_ERR_NO_TMP_DIR, UPLOAD_ERR_CANT_WRITE, or UPLOAD_ERR_EXTENSION)

Tags
throws
InvalidArgumentException

When error code doesn't exist

Return values
mixed

setFilePath()

Sets path to the file as string for simulating HTTP request.

public setFilePath(string $path) : mixed
Parameters
$path : string
Return values
mixed

setValue()

Sets the value of the field.

public setValue(string|null $value) : mixed
Parameters
$value : string|null
Return values
mixed

upload()

Sets the value of the field.

public upload(string|null $value) : mixed
Parameters
$value : string|null
Return values
mixed

initialize()

Initializes the form field.

protected initialize() : mixed
Tags
throws
LogicException

When node type is incorrect

Return values
mixed

Search results