Class TextBase (namespace Nette\Forms)


Implements the basic functionality common to text input controls.

Object
   |
   --Component
      |
      --FormControl
         |
         --TextBase

Direct Known Sub-classes:

Copyright: Copyright (c) 2004, 2010 David Grudl
Abstract:
Located: in /Forms/Controls/TextBase.php (line 23)
Public Method Summary
TextBase
addFilter (callback $filter)
Appends input string filter callback.
static string
filterFloat (string $s)
Float string cleanup.
string
Returns the special value which is treated as empty string.
string
Returns control's value.
void
notifyRule (Rule $rule)
TextBase
setEmptyValue (string $value)
Sets the special value which is treated as empty string.
TextBase
setValue (string $value)
Sets control's value.
static bool
validateEmail (TextBase $control)
Email validator: is control's value valid email address?
static bool
validateFloat (TextBase $control)
Float validator: is a control's value float number?
static bool
Integer validator: is a control's value decimal number?
static bool
validateLength (TextBase $control, array $range)
Length validator: is control's value length in range?
static bool
validateMaxLength (TextBase $control, int $length)
Max-length validator: is control's value length in limit?
static bool
validateMinLength (TextBase $control, int $length)
Min-length validator: has control's value minimal length?
static bool
validateRange (TextBase $control, array $range)
Rangle validator: is a control's value number in specified range?
static bool
validateRegexp (TextBase $control, string $regexp)
Regular expression validator: matches control's value regular expression?
static bool
validateUrl (TextBase $control)
URL validator: is control's value valid URL?
Methods Inherited From FormControl
__construct(), addCondition(), addConditionOn(), addError(), addRule(), attached(), cleanErrors(), getControl(), getControlPrototype(), getErrors(), getForm(), getHtmlId(), getHtmlName(), getLabel(), getLabelPrototype(), getOption(), getOptions(), getRules(), getTranslator(), getValue(), hasErrors(), isDisabled(), isRendered(), isRequired(), loadHttpData(), notifyRule(), setDefaultValue(), setDisabled(), setHtmlId(), setOption(), setRendered(), setRequired(), setTranslator(), setValue(), translate(), validateEqual(), validateFilled(), validateValid()
Methods Inherited From Component
__construct(), attached(), detached(), getName(), getParent(), lookup(), lookupPath(), monitor(), setParent(), unmonitor(), validateParent(), __clone(), __wakeup()
Methods Inherited From Object
extensionMethod(), getClass(), getReflection(), __call(), __callStatic(), __get(), __isset(), __set(), __unset()
Variable Summary
protected string $emptyValue ''

line 26

protected array $filters array()

line 29


Method Details

line 90

addFilter

public TextBase addFilter (callback $filter)

Appends input string filter callback.

Input
callback $filter
Output
TextBase provides a fluent interface

line 235

filterFloat

public static string filterFloat (string $s)

Float string cleanup.

Input
string $s
Output
string  

line 78

getEmptyValue

public string getEmptyValue ()

Returns the special value which is treated as empty string.

Output
string  

line 50

getValue

public string getValue ()

Returns control's value.

Output
string  

line 98

notifyRule

public void notifyRule (Rule $rule)

Overridden in child classes as:

Input
Rule $rule
Output
void  

line 66

setEmptyValue

public TextBase setEmptyValue (string $value)

Sets the special value which is treated as empty string.

Input
string $value
Output
TextBase provides a fluent interface

line 38

setValue

public TextBase setValue (string $value)

Sets control's value.

Input
string $value
Output
TextBase provides a fluent interface

line 157

validateEmail

public static bool validateEmail (TextBase $control)

Email validator: is control's value valid email address?

Input
TextBase $control
Output
bool  

line 210

validateFloat

public static bool validateFloat (TextBase $control)

Float validator: is a control's value float number?

Input
TextBase $control
Output
bool  

line 198

validateInteger

public static bool validateInteger (TextBase $control)

Integer validator: is a control's value decimal number?

Input
TextBase $control
Output
bool  

line 141

validateLength

public static bool validateLength (TextBase $control, array $range)

Length validator: is control's value length in range?

Input
TextBase $control
array $range min and max length pair
Output
bool  

line 128

validateMaxLength

public static bool validateMaxLength (TextBase $control, int $length)

Max-length validator: is control's value length in limit?

Input
TextBase $control
int $length length
Output
bool  

line 115

validateMinLength

public static bool validateMinLength (TextBase $control, int $length)

Min-length validator: has control's value minimal length?

Input
TextBase $control
int $length length
Output
bool  

line 223

validateRange

public static bool validateRange (TextBase $control, array $range)

Rangle validator: is a control's value number in specified range?

Input
TextBase $control
array $range min and max value pair
Output
bool  

line 186

validateRegexp

public static bool validateRegexp (TextBase $control, string $regexp)

Regular expression validator: matches control's value regular expression?

Input
TextBase $control
string $regexp
Output
bool  

line 173

validateUrl

public static bool validateUrl (TextBase $control)

URL validator: is control's value valid URL?

Input
TextBase $control
Output
bool