kartik\builder\BaseForm::renderActiveInput PHP Method

renderActiveInput() protected static method

Renders active input based on the attribute settings. This includes additional markup like rendering content before and after input, and wrapping input in a container if set.
protected static renderActiveInput ( kartik\form\ActiveForm $form, Model $model, string $attribute, array $settings ) : kartik\form\ActiveField
$form kartik\form\ActiveForm the form instance.
$model yii\base\Model the data model.
$attribute string the name of the attribute.
$settings array the attribute settings.
return kartik\form\ActiveField
    protected static function renderActiveInput($form, $model, $attribute, $settings)
    {
        $container = ArrayHelper::getValue($settings, 'container', []);
        $prepend = ArrayHelper::getValue($settings, 'prepend', '');
        $append = ArrayHelper::getValue($settings, 'append', '');
        $input = static::renderRawActiveInput($form, $model, $attribute, $settings);
        $out = $prepend . "\n" . $input . "\n" . $append;
        return empty($container) ? $out : Html::tag('div', $out, $container);
    }