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

VALID

Methods

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

No description

void
loadHttpData()

No description

string
getHtmlName()

No description

setValue($value)

No description

FileUpload|array|null
getValue()

Returns the uploaded file(s), a dummy FileUpload(null) when nothing was uploaded, or null when nullable is set.

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)

No description

Details

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

No description

Parameters

string|Stringable|null $label
bool $multiple

at line 56
void loadHttpData()

No description

Return Value

void

at line 62
string getHtmlName()

No description

Return Value

string

at line 71
UploadControl setValue($value)

internal  
 

No description

Parameters

$value

Return Value

UploadControl

at line 81
FileUpload|array|null getValue()

Returns the uploaded file(s), a dummy FileUpload(null) when nothing was uploaded, or null when nullable is set.

Return Value

FileUpload|array|null

at line 90
bool isFilled()

Has been any file uploaded?

Return Value

bool

at line 99
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 106
bool isNullable()

No description

Return Value

bool

at line 116
bool isOk()

internal  
 

Have been all files successfully uploaded?

Return Value

bool

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

No description

Parameters

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

Return Value

UploadControl