Skip to content

Commit a138324

Browse files
Refactor input widget instantiation in FilePond.php. (#13)
1 parent faa930f commit a138324

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

src/FilePond.php

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use JsonException;
88
use PHPForge\Html\Helper\CssClass;
99
use PHPForge\Html\Helper\Utils;
10-
use PHPForge\Html\Input;
10+
use PHPForge\Html\Tag;
1111
use Yii2\Extensions\FilePond\Asset\FilePondAsset;
1212
use Yii2\Extensions\FilePond\Asset\FilePondCdnAsset;
1313
use Yii;
@@ -322,19 +322,6 @@ private function renderInputFile(): string
322322
// input type="file" not supported value attribute.
323323
unset($options['id'], $options['placeholder'], $options['value']);
324324

325-
return match ($this->hasModel()) {
326-
true => Input::widget()
327-
->attributes($options)
328-
->id($this->id)
329-
->name($name)
330-
->type('file')
331-
->render(),
332-
default => Input::widget()
333-
->attributes($options)
334-
->id($this->id)
335-
->name($name)
336-
->type('file')
337-
->render(),
338-
};
325+
return Tag::widget()->attributes($options)->id($this->id)->name($name)->tagName('input')->type('file')->render();
339326
}
340327
}

0 commit comments

Comments
 (0)