@@ -17,8 +17,9 @@ discard block |
||
17 | 17 | use yii\helpers\Html; |
18 | 18 | use yii\web\View; |
19 | 19 | |
20 | -if (is_array($model)) |
|
20 | +if (is_array($model)) { |
|
21 | 21 | $model = $model[array_key_first($model)]; |
22 | +} |
|
22 | 23 | |
23 | 24 | $doc_contents = [ |
24 | 25 | 'application/msword', |
@@ -38,7 +39,8 @@ discard block |
||
38 | 39 | <?= Html::hiddenInput((new ReflectionClass($model->class))->getShortName() . "[{$model->field}_ids][]", $model->id) ?> |
39 | 40 | </div> |
40 | 41 | |
41 | - <?php else: ?> |
|
42 | + <?php else { |
|
43 | + : ?> |
|
42 | 44 | |
43 | 45 | <div data-title="<?= $model->title ?>" |
44 | 46 | id="yii2-file-object-<?= $model->id ?>" |
@@ -52,7 +54,9 @@ discard block |
||
52 | 54 | <?php if ($model->type != FileType::IMAGE): ?> |
53 | 55 | <?= $model->icon ?> |
54 | 56 | <?= $model->title ?> |
55 | - <?php endif; ?> |
|
57 | + <?php endif; |
|
58 | +} |
|
59 | +?> |
|
56 | 60 | </div> |
57 | 61 | <?php endif; ?> |
58 | 62 |