abstract class TextBase extends BaseControl

Implements the basic functionality common to text input controls.

Properties

protected $emptyValue
protected $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.

bool
isNullable()

No description

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.

Html|string
getControl()

Generates control's HTML element.

string|null
getRenderedValue()

No description

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

No description

Details

at line 33
Control setValue(mixed $value)

internal  
 

Sets control's value.

Parameters

mixed $value

Return Value

Control

at line 51
mixed getValue()

Returns control's value.

Return Value

mixed

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

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

Parameters

bool $value

Return Value

TextBase

at line 70
bool isNullable()

No description

Return Value

bool

at line 79
TextBase setEmptyValue(string $value)

Sets the special value which is treated as empty string.

Parameters

string $value

Return Value

TextBase

at line 89
string getEmptyValue()

Returns the special value which is treated as empty string.

Return Value

string

at line 98
TextBase setMaxLength(int $length)

Sets the maximum number of allowed characters.

Parameters

int $length

Return Value

TextBase

at line 105
Html|string getControl()

Generates control's HTML element.

Return Value

Html|string

at line 120
protected string|null getRenderedValue()

No description

Return Value

string|null

at line 129
BaseControl 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

BaseControl