コード例 #1
0
 public function getAttributes()
 {
     $attrs = array();
     if (self::config()->use_v3 && $this->tags) {
         $attrs['type'] = 'hidden';
         $values = $this->Value();
         if (is_array($values)) {
             // If we have a source, replace keys by values
             if ($this->source && is_array($this->source)) {
                 $newValues = array();
                 foreach ($values as $val) {
                     if (!isset($this->source[$val])) {
                         continue;
                     }
                     $newValues[] = $this->source[$val];
                 }
                 $values = $newValues;
             }
             $values = implode(self::SEPARATOR, $values);
         }
         $attrs['value'] = $values;
     }
     return array_merge(parent::getAttributes(), $attrs);
 }
 /**
  * @return array
  */
 public function getAttributes()
 {
     $attributes = parent::getAttributes();
     // Disable changetracking (we handle that manually) and chosen
     $attributes['class'] .= ' no-change-track multiselectfield no-chzn';
     $attributes['data-searchable'] = $this->getSearchable();
     $attributes['data-sortable'] = (bool) $this->getSort();
     $attributes['data-min-height'] = $this->getMinHeight();
     $attributes['data-max-height'] = $this->getMaxHeight();
     return $attributes;
 }