abstract class TextBase extends BaseControl

Implements the basic functionality common to text input controls.

Properties

protected string $emptyValue
protected mixed $rawValue

Methods

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.

setEmptyValue(string $value)

Sets the special value which is treated as empty string.

string
getEmptyValue()

Returns the special value which is treated as empty string.

setMaxLength(int $length)

Sets the maximum number of allowed characters.

addFilter(callable $filter)

Appends input string filter callback.

Html|string
getControl()

Generates control's HTML element.

string|null
getRenderedValue()

No description

addRule($validator, $errorMessage = null, $arg = null)

No description

Details

at line 37
IControl setValue(mixed $value)

Sets control's value.

Parameters

mixed $value

Return Value

IControl

at line 54
mixed getValue()

Returns control's value.

Return Value

mixed

at line 65
TextBase setNullable(bool $value = true)

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

Parameters

bool $value

Return Value

TextBase

at line 76
TextBase setEmptyValue(string $value)

Sets the special value which is treated as empty string.

Parameters

string $value

Return Value

TextBase

at line 86
string getEmptyValue()

Returns the special value which is treated as empty string.

Return Value

string

at line 96
TextBase setMaxLength(int $length)

Sets the maximum number of allowed characters.

Parameters

int $length

Return Value

TextBase

at line 107
TextBase addFilter(callable $filter)

Appends input string filter callback.

Parameters

callable $filter

Return Value

TextBase

at line 114
Html|string getControl()

Generates control's HTML element.

Return Value

Html|string

at line 127
protected string|null getRenderedValue()

Return Value

string|null

at line 138
BaseControl addRule($validator, $errorMessage = null, $arg = null)

Parameters

$validator
$errorMessage
$arg

Return Value

BaseControl