class HiddenField extends BaseControl

Hidden form control used to store a non-displayed value.

Methods

__construct($persistentValue = null)

No description

setValue(mixed $value)

Sets control's value.

mixed
getValue()

Returns control's value.

setNullable(bool $value = true)

Sets whether getValue() returns null instead of empty string.

Html|string
getControl()

Generates control's HTML element.

Html|string|null
getLabel(string|Stringable|null $caption = null)

Bypasses label generation.

void
addError(string|Stringable $message, bool $translate = true)

Adds error message to the list.

Details

at line 26
__construct($persistentValue = null)

No description

Parameters

$persistentValue

at line 44
Control setValue(mixed $value)

internal  
 

Sets control's value.

Parameters

mixed $value

Return Value

Control

at line 62
mixed getValue()

Returns control's value.

Return Value

mixed

at line 71
HiddenField setNullable(bool $value = true)

Sets whether getValue() returns null instead of empty string.

Parameters

bool $value

Return Value

HiddenField

at line 78
Html|string getControl()

Generates control's HTML element.

Return Value

Html|string

at line 93
Html|string|null getLabel(string|Stringable|null $caption = null)

Bypasses label generation.

Parameters

string|Stringable|null $caption

Return Value

Html|string|null

at line 102
void addError(string|Stringable $message, bool $translate = true)

Adds error message to the list.

Parameters

string|Stringable $message
bool $translate

Return Value

void