= $form->field($model, $fieldName)->widget(
FileInput::class,
[
'language' => $appLanguage,
'options' => ['multiple' => false],
'pluginOptions' => [
'maxFileCount' => 1,
'showClose' => false,
'showRemove' => false,
'showUpload' => false,
'showCaption' => true,
'showPreview' => true,
'dropZoneEnabled' => false,
'overwriteInitial' => true,
'hideThumbnailContent' => false,
'removeFromPreviewOnError' => true,
'initialPreviewFileType' => 'image',
'initialPreviewAsData' => $showPreview,
'maxFileSize' => iniGet::getUploadMaxFilesize(),
'allowedFileExtensions' => $allowedFileExtensions,
'deleteUrl' => $showPreview ? $deleteUrl : $showPreview,
'initialCaption' => $showPreview ? $fileUrl : $showPreview,
'initialPreview' => $showPreview ? $fileUrl : $showPreview,
'initialPreviewConfig' => $showPreview ? [[
'type' => 'image',
'caption' => $fileUrl,
]] : $showPreview,
],
]
) ?>