protected function getStaticInput($type, $model, $index, $settings, $attribute, $formatter)
{
$format = ArrayHelper::getValue($settings, 'format', 'raw');
if ($type === self::INPUT_HIDDEN_STATIC) {
$options = ArrayHelper::getValue($settings, 'hiddenStaticOptions', []);
} else {
$options = ArrayHelper::getValue($settings, 'options', []);
}
$val = null;
if (isset($settings['staticValue'])) {
$val = $settings['staticValue'];
} else {
if (isset($settings['value'])) {
$val = $settings['value'];
} elseif ($model instanceof Model) {
$val = Html::getAttributeValue($model, $attribute);
} elseif (($models = $this->dataProvider->getModels()) && !empty($models[$index][$attribute])) {
$val = $models[$index][$attribute];
}
}
$val = $formatter->format($val, $format);
$prepend = ArrayHelper::getValue($settings, 'prepend', '');
$append = ArrayHelper::getValue($settings, 'append', '');
$val = $prepend . "\n" . $val . "\n" . $append;
Html::addCssClass($options, 'form-control-static');
return Html::tag('div', $val, $options);
}