]
],
[
- 'name' => 'videoFiles',
- 'title' => 'Видео: mp4, mov, avi',
- 'type' => FileInput::class,
- 'options' => [
- 'options' => [
- 'multiple' => false,
- 'accept' => 'video/*',
- 'name' => 'video_name',
- ],
- 'pluginOptions' => [
- 'showPreview' => true,
- 'showCaption' => true,
- 'showRemove' => true,
- 'showUpload' => false,
- 'previewFileType' => 'video',
- 'allowedFileExtensions' => ['mp4', 'mov', 'avi'],
- 'initialPreview' => isset($model->id) ? [ // или $row['id'], если это в цикле
- Files::find()
- ->select('url')
- ->where([
- 'entity' => WriteOffsProductsErp::WRITE_OFFS_VIDEO,
- 'entity_id' => $model->id // или $row['id']
- ])
- ->scalar()
- ] : [],
- 'initialPreviewAsData' => true,
- 'initialPreviewConfig' => isset($model->id) ? [[
- 'type' => 'video',
- 'caption' => basename(
- Files::find()
- ->select('url')
- ->where([
- 'entity' => WriteOffsProductsErp::WRITE_OFFS_VIDEO,
- 'entity_id' => $model->id
- ])
- ->scalar()
- ),
- 'url' => Url::to(['delete-video', 'id' => $model->id]),
- ]] : [],
- ]
- ]
-],
+ 'name' => 'videoFiles',
+ 'title' => 'Видео: mp4, mov, avi',
+ 'type' => FileInput::class,
+ 'options' => [
+ 'options' => [
+ 'multiple' => false,
+ 'accept' => 'video/*',
+ 'name' => 'video_name',
+ ],
+ 'pluginOptions' => [
+ 'showPreview' => true,
+ 'showCaption' => false,
+ 'showRemove' => true,
+ 'showUpload' => false,
+ 'browseIcon' => '+',
+ 'cancelIcon' => 'x',
+ 'removeIcon' => '-',
+ 'buttonLabelClass' => 'hidden',
+ 'fileActionSettings' => [
+ 'showUpload' => false
+ ],
+ 'previewFileType' => 'video',
+ 'allowedFileExtensions' => ['mp4', 'mov', 'avi'],
+ 'initialPreview' => isset($model->id) ? [
+ Files::find()
+ ->select('url')
+ ->where([
+ 'entity' => WriteOffsProductsErp::WRITE_OFFS_VIDEO,
+ 'entity_id' => $model->id
+ ])
+ ->scalar()
+ ] : [],
+ 'initialPreviewAsData' => true,
+ 'initialPreviewConfig' => isset($model->id) ? [[
+ 'type' => 'video',
+ 'caption' => basename(
+ Files::find()
+ ->select('url')
+ ->where([
+ 'entity' => WriteOffsProductsErp::WRITE_OFFS_VIDEO,
+ 'entity_id' => $model->id
+ ])
+ ->scalar()
+ ),
+ 'url' => Url::to(['delete-video', 'id' => $model->id]),
+ ]] : [],
+ ]
+ ]
+ ],
[
'name' => 'comment',
'type' => 'textInput',