/** * {@inheritDoc} */ public function getAttributes() { $attributes = array('id' => $this->getId(), 'name' => $this->getName(), 'disabled' => $this->isDisabled()); // Add "[]" to the name in case a select tag with multiple options is // displayed. Otherwise only one of the selected options is sent in the // POST request. if ($this->getOption('multiple') && !$this->getOption('expanded')) { $attributes['name'] .= '[]'; } if ($this->getOption('multiple')) { $attributes['multiple'] = 'multiple'; } return array_merge(parent::getAttributes(), $attributes); }
/** * {@inheritDoc} */ public function getAttributes() { if ($this->isField()) { return array_merge(parent::getAttributes(), array('id' => $this->getId(), 'name' => $this->getName(), 'value' => $this->getDisplayedData(), 'type' => 'text')); } return parent::getAttributes(); }