/** * Get default widget class based on input field type * @param string $type * @return string */ public static function getWidgetClassNameFromFieldType($type) { switch ($type) { case self::INPUT_DATE: $widgetClass = DatePicker::className(); break; case self::INPUT_DATETIME: $widgetClass = DateTimePicker::className(); break; case self::INPUT_COLOR: $widgetClass = ColorInput::className(); break; case self::INPUT_SELECT2_MULTI: case self::INPUT_SELECT2_TAGS: case self::INPUT_SELECT2: $widgetClass = Select2::className(); break; case self::INPUT_SELECT_PICKER: case self::INPUT_SELECT_PICKER_MULTI: $widgetClass = BootstrapSelect::className(); break; case self::INPUT_EDITOR_CK: $widgetClass = CKEditor::className(); break; case self::INPUT_EDITOR_BS_WYSIHTML5: $widgetClass = BootstrapWysihtml5::className(); break; case self::INPUT_EDITOR_BS_SUMMERNOTE: $widgetClass = BootstrapSummernote::className(); break; default: $widgetClass = ''; break; } return $widgetClass; }
public function datePicker($options) { return $this->widget(DatePicker::className(), ['options' => $options]); }