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 | ||
bool | $omitted | ||
bool | $required | ||
Form read-only | $form | ||
string read-only | $htmlName | ||
Html read-only | $controlPrototype | ||
Html read-only | $labelPrototype | ||
array read-only | $errors |
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.
Alias for setHtmlAttribute()
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
Sets user-specific option.
Returns user-specific option.
Returns user-specific options.
Details
at line 71
__construct($caption = NULL)
No description
at line 88
protected void
attached($form)
This method will be called when the component becomes attached to Form.
at line 101
Form
getForm($need = TRUE)
Returns form.
at line 111
void
loadHttpData()
Loads HTTP data.
at line 121
mixed
getHttpData($type, $htmlTail = NULL)
Loads HTTP data.
at line 131
string
getHtmlName()
Returns HTML name of control.
at line 145
void
setValue($value)
internal |
Sets control's value.
at line 156
mixed
getValue()
Returns control's value.
at line 166
bool
isFilled()
Is control filled?
at line 177
BaseControl
setDefaultValue($value)
Sets control's default value.
at line 192
BaseControl
setDisabled($value = TRUE)
Disables or enables control.
at line 206
bool
isDisabled()
Is control disabled?
at line 217
BaseControl
setOmitted($value = TRUE)
Sets whether control value is excluded from $form->getValues() result.
at line 228
bool
isOmitted()
Is control value excluded from $form->getValues() result?
at line 241
Html|string
getControl()
Generates control's HTML element.
at line 260
Html|string
getLabel($caption = NULL)
Generates label's HTML element.
at line 273
Html
getControlPrototype()
Returns control's HTML element template.
at line 283
Html
getLabelPrototype()
Returns label's HTML element template.
at line 294
BaseControl
setHtmlId($id)
Changes control's HTML id.
at line 305
string
getHtmlId()
Returns control's HTML id.
at line 320
BaseControl
setHtmlAttribute($name, $value = TRUE)
Changes control's HTML attribute.
at line 332
BaseControl
setAttribute($name, $value = TRUE)
Alias for setHtmlAttribute()
at line 346
BaseControl
setTranslator(ITranslator $translator = NULL)
Sets translate adapter.
at line 357
ITranslator|null
getTranslator()
Returns translate adapter.
at line 372
string
translate($value, $count = NULL)
Returns translated string.
at line 396
BaseControl
addRule($validator, $message = NULL, $arg = NULL)
Adds a validation rule.
at line 409
Rules
addCondition($validator, $value = NULL)
Adds a validation condition a returns new branch.
at line 422
Rules
addConditionOn(IControl $control, $validator, $value = NULL)
Adds a validation condition based on another control a returns new branch.
at line 431
Rules
getRules()
No description
at line 442
BaseControl
setRequired($value = TRUE)
Makes control mandatory.
at line 453
bool
isRequired()
Is control mandatory?
at line 463
void
validate()
Performs the server side validation.
at line 478
void
addError($message)
Adds error message to the list.
at line 488
string
getError()
Returns errors corresponding to control.
at line 498
array
getErrors()
Returns errors corresponding to control.
at line 507
bool
hasErrors()
No description
at line 516
void
cleanErrors()
No description
at line 523
static protected
exportRules($rules)
deprecated
deprecated
No description
at line 537
BaseControl
setOption($key, $value)
Sets user-specific option.
at line 552
mixed
getOption($key, $default = NULL)
Returns user-specific option.
at line 562
array
getOptions()
Returns user-specific options.