: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace Nextend\Framework\Form\Element\Select;
use Nextend\Framework\Form\Element\Select;
use Nextend\Framework\Platform\Platform;
class SelectFile extends Select {
* @param string $extension
* @param array $parameters
public function __construct($insertAt, $name = '', $label = '', $default = '', $extension = '', $parameters = array()) {
parent::__construct($insertAt, $name, $label, $default, $parameters);
$dir = Platform::getPublicDirectory();
$validated_files = array();
foreach ($files as $file) {
if (strtolower(pathinfo($file, PATHINFO_EXTENSION)) == $extension) {
$validated_files[] = $file;
$this->options[''] = n2_('Choose');
foreach ($validated_files as $f) {