Beispiel #1
0
 /**
  * Get option attributes
  *
  * @param mixed $value Value
  * @param mixed $text  Text
  *
  * @return array
  */
 protected function getOptionAttributes($value, $text)
 {
     $attributes = parent::getOptionAttributes($value, $text);
     if ($this->isOptionSelected($value)) {
         $attributes['checked'] = 'checked';
     }
     if (isset($attributes['selected'])) {
         unset($attributes['selected']);
     }
     $attributes['type'] = 'checkbox';
     $attributes['name'] = $this->getName() . '[' . $value . ']';
     $fieldAttributes = $this->getAttributes();
     if (!empty($fieldAttributes['disabled'])) {
         $attributes['disabled'] = 'disabled';
     }
     return $attributes;
 }