BaseControl
abstract class BaseControl extends Component implements IControl
Base class that implements the basic functionality common to form controls.
Properties
static string | $idMask | ||
string | $caption | ||
mixed | $value | ||
Html read-only | $control | ||
Html read-only | $label | ||
bool | $disabled | ||
string | $htmlId | ||
ITranslator|null | $translator | ||
bool | $omitted | ||
bool | $required | ||
Form read-only | $form | ||
string read-only | $htmlName | ||
array read-only | $options | ||
bool read-only | $filled | ||
Html read-only | $controlPrototype | ||
Html read-only | $labelPrototype | ||
Rules read-only | $rules | ||
array read-only | $errors | ||
write-only | $defaultValue |
Methods
No description
This method will be called when the component becomes attached to Form.
Loads HTTP data.
Loads HTTP data.
Returns HTML name of control.
Sets control's value.
Returns control's value.
Is control filled?
Sets control's default value.
Disables or enables control.
Is control disabled?
Sets whether control value is excluded from $form->getValues() result.
Is control value excluded from $form->getValues() result?
Generates control's HTML element.
Generates label's HTML element.
Returns control's HTML element template.
Returns label's HTML element template.
Changes control's HTML id.
Returns control's HTML id.
Changes control's HTML attribute.
Sets translate adapter.
Returns translate adapter.
Returns translated string.
Adds a validation rule.
Adds a validation condition a returns new branch.
Adds a validation condition based on another control a returns new branch.
Makes control mandatory.
Is control mandatory?
Performs the server side validation.
Adds error message to the list.
Returns errors corresponding to control.
Returns errors corresponding to control.
No description
No description
No description
Is a control's value number greater than or equal to the specified minimum?
Is a control's value number less than or equal to the specified maximum?
Count/length validator. Range is array, min and max length pair.
Sets user-specific option.
Returns user-specific option.
Returns user-specific options.
Details
at line 79
__construct($caption = NULL)
No description
at line 96
protected void
attached($form)
This method will be called when the component becomes attached to Form.
at line 109
Form
getForm($need = TRUE)
Returns form.
at line 119
void
loadHttpData()
Loads HTTP data.
at line 129
mixed
getHttpData($type, $htmlTail = NULL)
Loads HTTP data.
at line 139
string
getHtmlName()
Returns HTML name of control.
at line 152
void
setValue($value)
Sets control's value.
at line 163
mixed
getValue()
Returns control's value.
at line 173
bool
isFilled()
Is control filled?
at line 184
BaseControl
setDefaultValue($value)
Sets control's default value.
at line 199
BaseControl
setDisabled($value = TRUE)
Disables or enables control.
at line 213
bool
isDisabled()
Is control disabled?
at line 224
BaseControl
setOmitted($value = TRUE)
Sets whether control value is excluded from $form->getValues() result.
at line 235
bool
isOmitted()
Is control value excluded from $form->getValues() result?
at line 248
Html|string
getControl()
Generates control's HTML element.
at line 267
Html|string
getLabel($caption = NULL)
Generates label's HTML element.
at line 280
Html
getControlPrototype()
Returns control's HTML element template.
at line 290
Html
getLabelPrototype()
Returns label's HTML element template.
at line 301
BaseControl
setHtmlId($id)
Changes control's HTML id.
at line 312
string
getHtmlId()
Returns control's HTML id.
at line 327
BaseControl
setAttribute($name, $value = TRUE)
Changes control's HTML attribute.
at line 341
BaseControl
setTranslator(ITranslator $translator = NULL)
Sets translate adapter.
at line 352
ITranslator|null
getTranslator()
Returns translate adapter.
at line 367
string
translate($value, $count = NULL)
Returns translated string.
at line 391
BaseControl
addRule($validator, $message = NULL, $arg = NULL)
Adds a validation rule.
at line 404
Rules
addCondition($validator, $value = NULL)
Adds a validation condition a returns new branch.
at line 417
Rules
addConditionOn(IControl $control, $validator, $value = NULL)
Adds a validation condition based on another control a returns new branch.
at line 426
Rules
getRules()
No description
at line 437
BaseControl
setRequired($value = TRUE)
Makes control mandatory.
at line 448
bool
isRequired()
Is control mandatory?
at line 458
void
validate()
Performs the server side validation.
at line 473
void
addError($message)
Adds error message to the list.
at line 483
string
getError()
Returns errors corresponding to control.
at line 493
array
getErrors()
Returns errors corresponding to control.
at line 502
bool
hasErrors()
No description
at line 511
void
cleanErrors()
No description
at line 520
static protected array
exportRules($rules)
No description
at line 565
static bool
validateEqual(IControl $control, $arg)
internal |
Is control's value equal with second parameter?
at line 585
static bool
validateNotEqual(IControl $control, $arg)
internal |
Is control's value not equal with second parameter?
at line 596
static bool
validateFilled(IControl $control)
internal |
Is control filled?
at line 607
static bool
validateBlank(IControl $control)
internal |
Is control not filled?
at line 618
static bool
validateValid(IControl $control)
internal |
Is control valid?
at line 629
static bool
validateRange(IControl $control, $range)
internal |
Is a control's value number in specified range?
at line 640
static bool
validateMin(IControl $control, $minimum)
internal |
Is a control's value number greater than or equal to the specified minimum?
at line 651
static bool
validateMax(IControl $control, $maximum)
internal |
Is a control's value number less than or equal to the specified maximum?
at line 662
static bool
validateLength(IControl $control, $range)
internal |
Count/length validator. Range is array, min and max length pair.
at line 677
static bool
validateMinLength(IControl $control, $length)
internal |
Has control's value minimal count/length?
at line 688
static bool
validateMaxLength(IControl $control, $length)
internal |
Is control's value count/length in limit?
at line 701
BaseControl
setOption($key, $value)
Sets user-specific option.
at line 716
mixed
getOption($key, $default = NULL)
Returns user-specific option.
at line 726
array
getOptions()
Returns user-specific options.