: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace Nextend\Framework\Form\Element\Radio;
use Nextend\Framework\Filesystem\Filesystem;
use Nextend\Framework\Form\AbstractField;
use Nextend\Framework\Form\ContainerInterface;
use Nextend\Framework\Form\TraitFieldset;
class ImageListFromFolder extends ImageList implements ContainerInterface {
protected $filenameOnly = false;
protected function fetchElement() {
return parent::fetchElement();
private function initOptions() {
$value = $this->getValue();
$currentValue = basename($value);
if ($value !== $currentValue) {
$this->setValue($currentValue);
$files = Filesystem::files($this->folder);
for ($i = 0; $i < count($files); $i++) {
$ext = pathinfo($files[$i], PATHINFO_EXTENSION);
if (in_array($ext, $extensions)) {
$path = $this->folder . $files[$i];
if ($this->filenameOnly) {
$value = pathinfo($files[$i], PATHINFO_FILENAME);
$value = basename($files[$i]);
$this->options[$value] = array(
if (!isset($this->options[$currentValue])) {
foreach ($this->options as $value => $option) {
if (pathinfo($value, PATHINFO_FILENAME) == $currentValue) {
$this->setValue($currentValue);
protected function postHTML() {
$html = '<div class="n2_field_image_list__fields">';
$html .= $this->decorateElement($element);
$element = $element->getNext();
public function setFolder($folder) {
public function setFilenameOnly($value) {
$this->filenameOnly = $value;
* @param AbstractField $element
public function decorateElement($element) {
$html = '<div class="n2_field">';
$html .= '<div class="n2_field__label">';
$html .= $element->fetchTooltip();
$html .= '<div class="n2_field__element">';
$html .= $element->fetchElement();