Skip to content

Commit

Permalink
Refactor input widget instantiation in FilePond.php. (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw authored Jan 2, 2024
1 parent faa930f commit a138324
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/FilePond.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use JsonException;
use PHPForge\Html\Helper\CssClass;
use PHPForge\Html\Helper\Utils;
use PHPForge\Html\Input;
use PHPForge\Html\Tag;
use Yii2\Extensions\FilePond\Asset\FilePondAsset;
use Yii2\Extensions\FilePond\Asset\FilePondCdnAsset;
use Yii;
Expand Down Expand Up @@ -322,19 +322,6 @@ private function renderInputFile(): string
// input type="file" not supported value attribute.
unset($options['id'], $options['placeholder'], $options['value']);

return match ($this->hasModel()) {
true => Input::widget()
->attributes($options)
->id($this->id)
->name($name)
->type('file')
->render(),
default => Input::widget()
->attributes($options)
->id($this->id)
->name($name)
->type('file')
->render(),
};
return Tag::widget()->attributes($options)->id($this->id)->name($name)->tagName('input')->type('file')->render();
}
}

0 comments on commit a138324

Please sign in to comment.