class UploadControl extends BaseControl

Text box and browse button that allow users to select a file to upload to the server.

Constants

Valid

validation rule

deprecated VALID

Methods

__construct(string|Stringable|null $label = null, bool $multiple = false)

No description

void
loadHttpData()

Loads HTTP data.

string
getHtmlName()

Returns HTML name of control.

setValue(mixed $value)

No description

mixed
getValue()

Returns control's value.

bool
isFilled()

Has been any file uploaded?

setNullable(bool $value = true)

Sets whether getValue() returns null instead of FileUpload with error UPLOAD_ERR_NO_FILE.

bool
isNullable()

No description

bool
isOk()

Have been all files successfully uploaded?

addRule(callable|string $validator, string|Stringable|null $errorMessage = null, mixed $arg = null)

Adds a validation rule.

Details

at line 34
__construct(string|Stringable|null $label = null, bool $multiple = false)

No description

Parameters

string|Stringable|null $label
bool $multiple

at line 57
void loadHttpData()

Loads HTTP data.

Return Value

void

at line 63
string getHtmlName()

Returns HTML name of control.

Return Value

string

at line 72
Control setValue(mixed $value)

internal  
 

No description

Parameters

mixed $value

Return Value

Control

at line 78
mixed getValue()

Returns control's value.

Return Value

mixed

at line 87
bool isFilled()

Has been any file uploaded?

Return Value

bool

at line 96
UploadControl setNullable(bool $value = true)

Sets whether getValue() returns null instead of FileUpload with error UPLOAD_ERR_NO_FILE.

Parameters

bool $value

Return Value

UploadControl

at line 103
bool isNullable()

No description

Return Value

bool

at line 113
bool isOk()

internal  
 

Have been all files successfully uploaded?

Return Value

bool

at line 123
BaseControl addRule(callable|string $validator, string|Stringable|null $errorMessage = null, mixed $arg = null)

Adds a validation rule.

Parameters

callable|string $validator
string|Stringable|null $errorMessage
mixed $arg

Return Value

BaseControl