TextBase
abstract class TextBase extends BaseControl
Base for text-based controls (TextInput, TextArea) with nullable and empty-value support.
Properties
| protected | $emptyValue | ||
| protected | $rawValue |
Methods
Returns the value, substituting empty string when it matches the empty value. Returns null when nullable is set and value is empty.
Sets whether getValue() returns null instead of empty string.
No description
Sets the special value which is treated as empty string.
Returns the special value which is treated as empty string.
Sets the maximum number of allowed characters.
Generates control's HTML element.
No description
No description
Details
at line 28
Control
setValue(mixed $value)
| internal |
No description
at line 45
mixed
getValue()
Returns the value, substituting empty string when it matches the empty value. Returns null when nullable is set and value is empty.
at line 57
TextBase
setNullable(bool $value = true)
Sets whether getValue() returns null instead of empty string.
at line 64
bool
isNullable()
No description
at line 73
TextBase
setEmptyValue(string $value)
Sets the special value which is treated as empty string.
at line 83
string
getEmptyValue()
Returns the special value which is treated as empty string.
at line 92
TextBase
setMaxLength(int|null $length)
Sets the maximum number of allowed characters.
at line 99
Html|string
getControl()
Generates control's HTML element.
at line 114
protected string|null
getRenderedValue()
No description
at line 123
BaseControl
addRule(callable|string $validator, string|Stringable|null $errorMessage = null, mixed $arg = null)
No description