class FileFormField extendsFormField

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

Methods

void
setErrorCode(int$error)

Sets the PHP error code associated with the field.

void
upload(string|null$value)

Sets the value of the field.

void
setValue(string|null$value)

Sets the value of the field.

void
setFilePath(string$path)

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

void
initialize()

Initializes the form field.

Details

void setErrorCode(int$error)

Sets the PHP error code associated with the field.

Parameters

int $error 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)

Return Value

void

Exceptions

InvalidArgumentException When error code doesn't exist

void upload(string|null$value)

Sets the value of the field.

Parameters

string|null $value

Return Value

void

void setValue(string|null$value)

Sets the value of the field.

Parameters

string|null $value

Return Value

void

void setFilePath(string$path)

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

Parameters

string $path

Return Value

void

protectedvoid initialize()

Initializes the form field.

Return Value

void

Exceptions

LogicException When node type is incorrect