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

renderInputTag() protected method

Renders a checkbox input element.
protected renderInputTag ( $writer, $clientID, $onclick )
    protected function renderInputTag($writer, $clientID, $onclick)
    {
        if ($clientID !== '') {
            $writer->addAttribute('id', $clientID);
        }
        $writer->addAttribute('type', 'checkbox');
        if (($value = $this->getValueAttribute()) !== '') {
            $writer->addAttribute('value', $value);
        }
        if (!empty($onclick)) {
            $writer->addAttribute('onclick', $onclick);
        }
        if (($uniqueID = $this->getUniqueID()) !== '') {
            $writer->addAttribute('name', $uniqueID);
        }
        if ($this->getChecked()) {
            $writer->addAttribute('checked', 'checked');
        }
        if (!$this->getEnabled(true)) {
            $writer->addAttribute('disabled', 'disabled');
        }
        $page = $this->getPage();
        if ($this->getEnabled(true) && $this->getEnableClientScript() && $this->getAutoPostBack() && $page->getClientSupportsJavaScript()) {
            $this->renderClientControlScript($writer);
        }
        if (($accesskey = $this->getAccessKey()) !== '') {
            $writer->addAttribute('accesskey', $accesskey);
        }
        if (($tabindex = $this->getTabIndex()) > 0) {
            $writer->addAttribute('tabindex', "{$tabindex}");
        }
        if ($attributes = $this->getViewState('InputAttributes', null)) {
            $writer->addAttributes($attributes);
        }
        $writer->renderBeginTag('input');
        $writer->renderEndTag();
    }

Usage Example

 /**
  * Override client implementation to avoid emitting the javascript
  *
  * @param THtmlWriter the writer for the rendering purpose
  * @param string checkbox id
  * @param string onclick js
  */
 protected function renderInputTag($writer, $clientID, $onclick)
 {
     TCheckBox::renderInputTag($writer, $clientID, $onclick);
 }
All Usage Examples Of Prado\Web\UI\WebControls\TCheckBox::renderInputTag