Beispiel #1
0
 /**
  * Renders a date input.
  *
  * @return $this the field object itself
  */
 public function dateInput($options = [])
 {
     if (isset($options['class'])) {
         $options['class'] = $this->inputOptions['class'] . ' ' . $options['class'];
     }
     $options = array_merge($this->inputOptions, $options);
     $options['class'] .= ' date-object';
     $this->adjustLabelFor($options);
     $this->model['attributes'][$this->attribute] = FieldHelper::getDateFromTimestamp($this->model['attributes'][$this->attribute], 'datePHPFormat');
     $input = '';
     $input .= '<div class="input-group">';
     $input .= '<div class="input-group-addon"><i class="fa fa-calendar"></i></div>';
     $input .= Html::activeTextInput($this->model, $this->attribute, $options);
     $input .= '</div>';
     $this->parts['{input}'] = $input;
     return $this;
 }