Class TextBase (namespace Nette\Forms)


Implements the basic functionality common to text input controls.

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

Direct Known Sub-classes:

Author: David Grudl
Copyright: Copyright (c) 2004, 2009 David Grudl
Abstract:
Located: in /Forms/Controls/TextBase.php (line 34)
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.
void
loadHttpData (array $data)
Loads HTTP data.
void
notifyRule (Rule $rule)
TextBase
setEmptyValue (string $value)
Sets the special value which is treated as empty string.
void
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(), cleanErrors(), getControl(), getControlPrototype(), getErrors(), getForm(), getHtmlId(), getHtmlName(), getLabel(), getLabelPrototype(), getOption(), getOptions(), getRules(), getTranslator(), getValue(), hasErrors(), isDisabled(), isRendered(), isRequired(), loadHttpData(), notifyRule(), setDisabled(), setHtmlId(), setOption(), setParent(), setRendered(), setRequired(), setTranslator(), setValue(), translate(), validateEqual(), validateFilled(), validateValid()
Methods Inherited From Component
__construct(), attached(), detached(), getName(), getParent(), getService(), getServiceLocator(), lookup(), lookupPath(), monitor(), setParent(), setServiceLocator(), validateParent(), __clone(), __wakeup()
Methods Inherited From Object
extensionMethod(), getClass(), getReflection(), __call(), __callStatic(), __get(), __isset(), __set(), __unset()
Variable Summary
protected string $emptyValue ''

line 37

protected array $filters array()

line 43

protected string $tmpValue

line 40


Method Details

line 106

addFilter

public TextBase addFilter (callback $filter)

Appends input string filter callback.

Input
callback $filter
Output
TextBase provides a fluent interface

line 253

filterFloat

public static string filterFloat (string $s)

Float string cleanup.

Input
string $s
Output
string  

line 94

getEmptyValue

public string getEmptyValue ()

Returns the special value which is treated as empty string.

Output
string  

line 68

loadHttpData

public void loadHttpData (array $data)

Loads HTTP data.

Overridden in child classes as:

Input
array $data
Output
void  

line 119

notifyRule

public void notifyRule (Rule $rule)

Overridden in child classes as:

Input
Rule $rule
Output
void  

line 82

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 52

setValue

public void setValue (string $value)

Sets control's value.

Input
string $value
Output
void  

line 179

validateEmail

public static bool validateEmail (TextBase $control)

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

Input
TextBase $control
Output
bool  

line 228

validateFloat

public static bool validateFloat (TextBase $control)

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

Input
TextBase $control
Output
bool  

line 216

validateInteger

public static bool validateInteger (TextBase $control)

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

Input
TextBase $control
Output
bool  

line 163

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 150

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 136

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 241

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 204

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 191

validateUrl

public static bool validateUrl (TextBase $control)

URL validator: is control's value valid URL?

Input
TextBase $control
Output
bool