Prado\Web\UI\WebControls\TCheckBox::renderLabel PHP Method

renderLabel() protected method

Renders a label beside the checkbox.
protected renderLabel ( $writer, $clientID, $text )
    protected function renderLabel($writer, $clientID, $text)
    {
        $writer->addAttribute('for', $clientID);
        if ($attributes = $this->getViewState('LabelAttributes', null)) {
            $writer->addAttributes($attributes);
        }
        $writer->renderBeginTag('label');
        $writer->write($text);
        $writer->renderEndTag();
    }

Usage Example

Beispiel #1
0
 /**
  * Renders a label beside the checkbox.
  * @param THtmlWriter the writer for the rendering purpose
  * @param string checkbox id
  * @param string label text
  */
 protected function renderLabel($writer, $clientID, $text)
 {
     $writer->addAttribute('id', $this->getDefaultLabelID());
     parent::renderLabel($writer, $clientID, $text);
 }