*/ class RadioField extends AbstractChoiceField { public function __construct($form, $name) { parent::__construct($form, 'radio', $name); } /** * Создаёт новый экземпляр опции * @return RadioOption */ protected function createOption($value, $text) { return new RadioOption($this, $value, $text); } public function appendAttributesToOption(AbstractChoiceOption $option, array & $attributes) { if ($this->isSelected($option)) { $attributes['checked'] = null; } if (!$option->hasCssClasses()) { $this->appendCssClassAttribute($attributes); } if (!$option->hasStyle()) { $this->appendStyleAttribute($attributes); } if ($this->isDisabled()) { $this->appendDisabledAttribute($attributes); } $attributes['name'] = $this->name(); if (!$option->hasId()) { $option->setId($this->name() . '_' . $option->value()); $attributes['id'] = $option->id(); } } }