예제 #1
0
 /**
  * Generates mini color widget [[MiniColor]].
  *
  * @param array $options colorPicker options
  * @return $this
  */
 public function miniColors($options = [])
 {
     $this->parts['{input}'] = MiniColors::widget(array_merge($options, ['model' => $this->model, 'attribute' => $this->attribute, 'form' => $this->form, 'type' => $this->type, 'addon' => $this->addon]));
     $this->addon = [];
     // addon already processed by widget
     return $this;
 }
예제 #2
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;
 }