public function renderInput($name, $options, $contextParams = [])
    {
        if ($this->options instanceof \Closure) {
            $optionsExt = call_user_func($this->options, $this->getModel());
        } else {
            $optionsExt = $this->options;
        }

        $options = ArrayHelper::merge($options, $optionsExt);
        $method = 'render' . Inflector::camelize($this->type);

        // @see https://github.com/unclead/yii2-multiple-input/issues/261
        if (isset($contextParams['index']) && isset($contextParams['indexPlaceholder'])) {
            $options = $this->replaceIndexPlaceholderInOptions($options, $contextParams['indexPlaceholder'], $contextParams['index']);
        }

        $value = null;
        if ($this->type !== self::TYPE_DRAGCOLUMN) {
            $value = $this->prepareValue($contextParams);
        }

        if (isset($options['items'])) {
            $options['items'] = $this->prepareItems($options['items']);
        }

        if (method_exists($this, $method)) {
            $input = $this->$method($name, $value, $options);
        } else {
            $input = $this->renderDefault($name, $value, $options);
        }

        return strtr($this->inputTemplate, ['{input}' => $input]);
    }