Esempio n. 1
0
 public function getAttributes(array $list)
 {
     $parentList = array_diff($list, ['min', 'max']);
     $ret = parent::getAttributes($parentList);
     if (in_array('placeholder', $list) && !isset($ret['placeholder'])) {
         // Messages: htmlform-date-placeholder htmlform-time-placeholder htmlform-datetime-placeholder
         $ret['placeholder'] = $this->msg("htmlform-{$this->mType}-placeholder")->text();
     }
     if (in_array('min', $list) && isset($this->mParams['min'])) {
         $min = $this->parseDate($this->mParams['min']);
         if ($min) {
             $ret['min'] = $this->formatDate($min);
             // Because Html::expandAttributes filters it out
             $ret['data-min'] = $ret['min'];
         }
     }
     if (in_array('max', $list) && isset($this->mParams['max'])) {
         $max = $this->parseDate($this->mParams['max']);
         if ($max) {
             $ret['max'] = $this->formatDate($max);
             // Because Html::expandAttributes filters it out
             $ret['data-max'] = $ret['max'];
         }
     }
     $ret['step'] = 1;
     // Because Html::expandAttributes filters it out
     $ret['data-step'] = 1;
     $ret['type'] = $this->mType;
     $ret['pattern'] = static::$patterns[$this->mType];
     return $ret;
 }
 public function getAttributes(array $list, array $mappings = null)
 {
     $attribs = array('type' => 'text', 'data-autocomplete' => FormatJson::encode(array_keys($this->autocomplete))) + parent::getAttributes($list, $mappings);
     if ($this->getOptions()) {
         $attribs['data-hide-if'] = FormatJson::encode(array('!==', $this->mName . '-select', 'other'));
     }
     return $attribs;
 }
Esempio n. 3
0
 public function getAttributes(array $list)
 {
     $attribs = ['type' => 'text', 'list' => $this->mName . '-datalist'] + parent::getAttributes($list);
     return $attribs;
 }
 public function getAttributes(array $list)
 {
     $attribs = ['type' => 'text', 'data-autocomplete' => FormatJson::encode(array_keys($this->autocomplete))] + parent::getAttributes($list);
     if ($this->getOptions()) {
         $attribs['data-hide-if'] = FormatJson::encode(['!==', $this->mName . '-select', 'other']);
     }
     return $attribs;
 }
 public function getAttributes(array $list, array $mappings = null)
 {
     $attribs = array('type' => 'text', 'list' => $this->mName . '-datalist') + parent::getAttributes($list, $mappings);
     return $attribs;
 }