/**
* Renders the label.
* It overrides the parent implementation by checking if an associated
* control is visible or not. If not, the label will not be rendered.
* @param THtmlWriter writer
*/
public function render($writer)
{
if (($aid = $this->getForControl()) !== '') {
if ($control = $this->findControl($aid)) {
if ($control->getVisible(true)) {
$this->_forControl = $control->getClientID();
parent::render($writer);
}
} else {
throw new TInvalidDataValueException('label_associatedcontrol_invalid', $aid);
}
} else {
parent::render($writer);
}
}