protected function onComponentTag(ComponentTag $tag) { parent::onComponentTag($tag); $this->checkComponentTag($tag, 'input'); $this->checkComponentTagAttribute($tag, 'type', 'checkbox'); $tag->put('value', $this->getValue()); $tag->put('name', $this->getName()); $tag->remove('checked'); if ($this->isSelected($this->getValue())) { $tag->put('checked', 'checked'); } }
protected function onComponentTag(ComponentTag $tag) { parent::onComponentTag($tag); $group = $this->getGroup(); $this->checkComponentTag($tag, 'input'); $this->checkComponentTagAttribute($tag, 'type', 'radio'); $tag->put('name', $group->getName()); $tag->put('value', $this->getValue()); $tag->remove('checked'); if ($this->isChecked()) { $tag->put('checked', 'checked'); } }
public function beforeComponentRender() { parent::beforeComponentRender(); $this->validateModel(); }