private static function getInputByType($type = 'text', $templateSetting = null, $keySetting = null, $value = null, $items = []){
        switch ($type) {
            case 'textarea':
                $templateSetting = Html::textarea($keySetting, $value, ['class' => 'form-control', 'title' => $keySetting]);
                break;
            case 'date':
                $templateSetting = DateControl::widget([
                    'name' => $keySetting,
                    'value' => $value,
                    'type'=>DateControl::FORMAT_DATE,
                    'ajaxConversion'=>false,
                    'options' => [
                        'pluginOptions' => [
                            'autoclose' => true
                        ],
                        'options' => ['title' => $keySetting],
                    ],
                    'displayFormat' => 'dd-MM-yyyy',
                    'saveFormat' => 'yyyy-MM-dd',
                ]);
                break;
            case 'datetime':
                $templateSetting = DateControl::widget([
                    'name' => $keySetting,
                    'value' => $value,
                    'type'=>DateControl::FORMAT_DATETIME,
                    'ajaxConversion'=>false,
                    'options' => [
                        'pluginOptions' => [
                            'autoclose' => true
                        ],
                        'options' => ['title' => $keySetting],
                    ],
                    'saveFormat' => 'yyyy-MM-dd',
                ]);
                break;
            case 'daterange':
                $templateSetting = DateRangePicker::widget([
                    'name' => $keySetting,
                    'value' => $value,
                    'presetDropdown'=>true,
                    'hideInput'=>true,
                    'options' => ['title' => $keySetting],
                ]);
                break;
            case 'dropdown':
                $templateSetting = Html::dropDownList($keySetting, $value, $items, ['class' => 'form-control', 'title' => $keySetting]);
                break;
            case 'checkbox':
                $templateSetting = Html::checkboxList($keySetting, $value, $items, ['class' => 'form-control', 'title' => $keySetting]);
                break;
            case 'radio':
                $templateSetting = Html::radioList($keySetting, $value, $items, ['class' => 'form-control', 'title' => $keySetting]);
                break;
            default:
                $templateSetting = Html::textInput($keySetting, $value, ['class' => 'form-control', 'title' => $keySetting]);
                break;
        }
        
        return $templateSetting;
    }