isChecked()) $this->setAttribute('checked', "checked"); else $this->removeAttribute('checked'); parent :: renderAttributes(); } function isChecked() { $value = $this->getValue(); // Here we really hard try to guess if it's checked or not... if(is_array($value) && in_array($this->getAttribute('value'), $value)) return true; elseif(is_scalar($value) && $value && $value == $this->getAttribute('value')) return true; elseif($value && !$this->getAttribute('value')) return true; elseif($this->hasAttribute('checked') && is_null($value)) return true; elseif($value && $value != $this->getAttribute('value')) return false; return false; } } ?>