|
|
@ -72,9 +72,17 @@ class ToggleButtonGroup extends InputWidget |
|
|
|
} |
|
|
|
} |
|
|
|
switch ($this->type) { |
|
|
|
switch ($this->type) { |
|
|
|
case 'checkbox': |
|
|
|
case 'checkbox': |
|
|
|
|
|
|
|
if ($this->hasModel()) { |
|
|
|
return Html::activeCheckboxList($this->model, $this->attribute, $this->items, $this->options); |
|
|
|
return Html::activeCheckboxList($this->model, $this->attribute, $this->items, $this->options); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return Html::checkboxList($this->name, $this->value, $this->items, $this->options); |
|
|
|
|
|
|
|
} |
|
|
|
case 'radio': |
|
|
|
case 'radio': |
|
|
|
|
|
|
|
if ($this->hasModel()) { |
|
|
|
return Html::activeRadioList($this->model, $this->attribute, $this->items, $this->options); |
|
|
|
return Html::activeRadioList($this->model, $this->attribute, $this->items, $this->options); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return Html::radioList($this->name, $this->value, $this->items, $this->options); |
|
|
|
|
|
|
|
} |
|
|
|
default: |
|
|
|
default: |
|
|
|
throw new InvalidConfigException("Unsupported type '{$this->type}'"); |
|
|
|
throw new InvalidConfigException("Unsupported type '{$this->type}'"); |
|
|
|
} |
|
|
|
} |
|
|
|