BaseControl
abstract class BaseControl extends Component implements IControl
Base class that implements the basic functionality common to form controls.
Properties
static string | $idMask | ||
string|object | $caption | ||
mixed | $value | ||
Html read-only | $control | ||
Html read-only | $label | ||
bool | $disabled | ||
mixed | $htmlId | ||
bool | $omitted | ||
bool | $required | ||
Form read-only | $form | ||
string read-only | $htmlName | ||
Html read-only | $controlPrototype | ||
Html read-only | $labelPrototype | ||
bool read-only | $filled | ||
array read-only | $errors | ||
array read-only | $options | ||
string read-only | $error |
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.
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.
No description
No description
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
Globally enables new required/optional behavior.
Sets user-specific option.
Returns user-specific option.
Returns user-specific options.
No description
No description
Details
at line 78
__construct($caption = null)
No description
at line 98
protected void
attached($form)
This method will be called when the component becomes attached to Form.
at line 111
Form|null
getForm($throw = true)
Returns form.
at line 121
void
loadHttpData()
Loads HTTP data.
at line 131
protected mixed
getHttpData($type, $htmlTail = null)
Loads HTTP data.
at line 141
string
getHtmlName()
Returns HTML name of control.
at line 155
IControl
setValue($value)
internal |
Sets control's value.
at line 166
mixed
getValue()
Returns control's value.
at line 176
bool
isFilled()
Is control filled?
at line 187
BaseControl
setDefaultValue($value)
Sets control's default value.
at line 202
BaseControl
setDisabled($value = true)
Disables or enables control.
at line 217
bool
isDisabled()
Is control disabled?
at line 228
BaseControl
setOmitted($value = true)
Sets whether control value is excluded from $form->getValues() result.
at line 239
bool
isOmitted()
Is control value excluded from $form->getValues() result?
at line 252
Html|string
getControl()
Generates control's HTML element.
at line 271
Html|string
getLabel($caption = null)
Generates label's HTML element.
at line 283
Html|null
getControlPart()
No description
at line 292
Html|null
getLabelPart()
No description
at line 302
Html
getControlPrototype()
Returns control's HTML element template.
at line 312
Html
getLabelPrototype()
Returns label's HTML element template.
at line 323
BaseControl
setHtmlId($id)
Changes control's HTML id.
at line 334
mixed
getHtmlId()
Returns control's HTML id.
at line 350
BaseControl
setHtmlAttribute($name, $value = true)
Changes control's HTML attribute.
at line 362
BaseControl
setAttribute($name, $value = true)
Alias for setHtmlAttribute()
at line 376
BaseControl
setTranslator(ITranslator $translator = null)
Sets translate adapter.
at line 387
ITranslator|null
getTranslator()
Returns translate adapter.
at line 402
mixed
translate($value, $count = null)
Returns translated string.
at line 426
BaseControl
addRule($validator, $errorMessage = null, $arg = null)
Adds a validation rule.
at line 439
Rules
addCondition($validator, $value = null)
Adds a validation condition a returns new branch.
at line 452
Rules
addConditionOn(IControl $control, $validator, $value = null)
Adds a validation condition based on another control a returns new branch.
at line 461
Rules
getRules()
No description
at line 472
BaseControl
setRequired($value = true)
Makes control mandatory.
at line 483
bool
isRequired()
Is control mandatory?
at line 493
void
validate()
Performs the server side validation.
at line 508
void
addError($message, $translate = true)
Adds error message to the list.
at line 518
string|null
getError()
Returns errors corresponding to control.
at line 528
array
getErrors()
Returns errors corresponding to control.
at line 537
bool
hasErrors()
No description
at line 546
void
cleanErrors()
No description
at line 556
static
enableAutoOptionalMode()
Globally enables new required/optional behavior.
This method will be deprecated in next version.
at line 569
BaseControl
setOption($key, $value)
Sets user-specific option.
at line 584
mixed
getOption($key, $default = null)
Returns user-specific option.
at line 594
array
getOptions()
Returns user-specific options.
at line 603
__call($name, $args)
No description
at line 612
static
extensionMethod($name, $callback = null)
No description