*/ class SelectField extends AbstractChoiceField { use SizeAttribute; public function __construct($form, $name) { parent::__construct($form, 'select', $name); } public function getAssociativeAttributes() { $attributes = parent::getAssociativeAttributes(); $this->appendSizeAttribute($attributes); if ($this->isMultiSelect()) { $attributes['multiple'] = null; } return $attributes; } /** * Создаёт новый экземпляр опции * @return SelectOption */ protected function createOption($value, $text) { return new SelectOption($this, $value, $text); } public function appendAttributesToOption(AbstractChoiceOption $option, array & $attributes) { if ($this->isSelected($option)) { $attributes['selected'] = null; } } }