function renderAttributes() { if ($this->isChecked()) { $this->setAttribute('checked', "checked"); } else { $this->removeAttribute('checked'); } parent::renderAttributes(); }
function renderAttributes() { $value = $this->getValue(); if (!is_null($value)) { $this->setAttribute('value', $value); } else { $this->setAttribute('value', ''); } parent::renderAttributes(); }