Source for file TextBase.php
Documentation is available at TextBase.php
- 1: <?php
- 3: /**
- 4: * Nette Framework
- 5: *
- 11: */
- 15: /**
- 16: * Implements the basic functionality common to text input controls.
- 17: *
- 20: *
- 22: */
- 24: {
- 33: /**
- 34: * Sets control's value.
- 37: */
- 39: {
- 42: }
- 46: /**
- 47: * Returns control's value.
- 49: */
- 51: {
- 55: }
- 57: }
- 61: /**
- 62: * Sets the special value which is treated as empty string.
- 65: */
- 67: {
- 70: }
- 74: /**
- 75: * Returns the special value which is treated as empty string.
- 77: */
- 79: {
- 81: }
- 85: /**
- 86: * Appends input string filter callback.
- 89: */
- 91: {
- 94: }
- 99: {
- 102: }
- 105: }
- 109: /**
- 110: * Min-length validator: has control's value minimal length?
- 114: */
- 116: {
- 118: }
- 122: /**
- 123: * Max-length validator: is control's value length in limit?
- 127: */
- 129: {
- 131: }
- 135: /**
- 136: * Length validator: is control's value length in range?
- 140: */
- 142: {
- 145: }
- 148: }
- 152: /**
- 153: * Email validator: is control's value valid email address?
- 156: */
- 158: {
- 160: $localPart = "(\"([ !\\x23-\\x5B\\x5D-\\x7E]*|\\\\[ -~])+\"|$atom+(\\.$atom+)*)"; // quoted or unquoted
- 163: return (bool) preg_match("(^$localPart@($domain?\\.)+[-$chars]{2,19}\\z)i", $control->getValue());
- 164: }
- 168: /**
- 169: * URL validator: is control's value valid URL?
- 172: */
- 174: {
- 176: }
- 180: /**
- 181: * Regular expression validator: matches control's value regular expression?
- 185: */
- 187: {
- 189: }
- 193: /**
- 194: * Integer validator: is a control's value decimal number?
- 197: */
- 199: {
- 201: }
- 205: /**
- 206: * Float validator: is a control's value float number?
- 209: */
- 211: {
- 213: }
- 217: /**
- 218: * Rangle validator: is a control's value number in specified range?
- 222: */
- 224: {
- 225: return ($range[0] === NULL || $control->getValue() >= $range[0]) && ($range[1] === NULL || $control->getValue() <= $range[1]);
- 226: }
- 230: /**
- 231: * Float string cleanup.
- 234: */
- 236: {
- 238: }
- 240: }