Exemplo n.º 1
0
 /**
  * Get default widget class based on input field type
  * @param string $type
  * @return string
  */
 public static function getWidgetClassNameFromFieldType($type)
 {
     switch ($type) {
         case self::INPUT_COLOR:
             $widgetClass = BootstrapColorPicker::className();
             break;
         case self::INPUT_MINI_COLORS:
             $widgetClass = MiniColors::className();
             break;
         case self::INPUT_DATE:
             $widgetClass = DatePicker::className();
             break;
         case self::INPUT_DATETIME:
             $widgetClass = DateTimePicker::className();
             break;
         case self::INPUT_MULTISELECT:
             $widgetClass = MultiSelect::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_SELECT_SPLITTER:
             $widgetClass = BootstrapSelectSplitter::className();
             break;
         case self::INPUT_TIME:
             $widgetClass = TimePicker::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;
 }