abstract class TextBase extends BaseControl

Implements the basic functionality common to text input controls.

Properties

string $emptyValue
protected array $filters
protected mixed $rawValue

Methods

void
setValue($value)

Sets control's value.

mixed
getValue()

Returns control's value.

setEmptyValue($value)

Sets the special value which is treated as empty string.

string
getEmptyValue()

Returns the special value which is treated as empty string.

setMaxLength($length)

Sets the maximum number of allowed characters.

addFilter($filter) deprecated

Appends input string filter callback.

Html|string
getControl()

Generates control's HTML element.

addRule($validator, $message = NULL, $arg = NULL)

Adds a validation rule.

static bool
validateEmail(TextBase $control)

Is control's value valid email address?

static bool
validateUrl(TextBase $control)

Is control's value valid URL?

static 
validateRegexp(TextBase $control, $regexp) deprecated

No description

static bool
validatePattern(TextBase $control, $pattern)

Matches control's value regular expression?

static bool
validateInteger(TextBase $control)

Is a control's value decimal number?

static bool
validateFloat(TextBase $control)

Is a control's value float number?

static string
filterFloat($s)

Float string cleanup.

Details

at line 40
void setValue($value)

Sets control's value.

Parameters

$value

Return Value

void

at line 56
mixed getValue()

Returns control's value.

Return Value

mixed

at line 74
TextBase setEmptyValue($value)

Sets the special value which is treated as empty string.

Parameters

$value

Return Value

TextBase

at line 85
string getEmptyValue()

Returns the special value which is treated as empty string.

Return Value

string

at line 96
TextBase setMaxLength($length)

Sets the maximum number of allowed characters.

Parameters

$length

Return Value

TextBase

at line 109
TextBase addFilter($filter) deprecated

deprecated

Appends input string filter callback.

Parameters

$filter

Return Value

TextBase

at line 116
Html|string getControl()

Generates control's HTML element.

Return Value

Html|string

at line 129
BaseControl addRule($validator, $message = NULL, $arg = NULL)

Adds a validation rule.

Parameters

$validator
$message
$arg

Return Value

BaseControl

at line 149
static bool validateEmail(TextBase $control)

internal  
 

Is control's value valid email address?

Parameters

TextBase $control

Return Value

bool

at line 160
static bool validateUrl(TextBase $control)

internal  
 

Is control's value valid URL?

Parameters

TextBase $control

Return Value

bool

at line 174
static validateRegexp(TextBase $control, $regexp) deprecated

deprecated

No description

Parameters

TextBase $control
$regexp

at line 186
static bool validatePattern(TextBase $control, $pattern)

internal  
 

Matches control's value regular expression?

Parameters

TextBase $control
$pattern

Return Value

bool

at line 197
static bool validateInteger(TextBase $control)

internal  
 

Is a control's value decimal number?

Parameters

TextBase $control

Return Value

bool

at line 214
static bool validateFloat(TextBase $control)

internal  
 

Is a control's value float number?

Parameters

TextBase $control

Return Value

bool

at line 231
static string filterFloat($s)

internal  
 

Float string cleanup.

Parameters

$s

Return Value

string