: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace Nextend\Framework\Form\Element;
use Nextend\Framework\Asset\Js\Js;
use Nextend\Framework\View\Html;
class SelectIcon extends AbstractFieldHidden {
public function __construct($insertAt, $name = '', $label = false, $options = array(), $default = '', $parameters = array()) {
$this->options = $options;
parent::__construct($insertAt, $name, $label, $default, $parameters);
protected function fetchElement() {
$currentValue = $this->getValue();
$html = Html::openTag('div', array(
'class' => 'n2_field_select_icon'
foreach ($this->options as $value => $option) {
$classes = array('n2_field_select_icon__option');
if ($currentValue == $value) {
$classes[] = 'n2_field_select_icon__option--selected';
$html .= Html::tag('div', array(
'class' => implode(' ', $classes),
), Html::tag('div', array(
'class' => 'n2_field_select_icon__option_icon'
), '<i class="' . $option['icon'] . '"></i>') . Html::tag('div', array(
'class' => 'n2_field_select_icon__option_label'
), $option['label']) . Html::tag('div', array(
'class' => 'n2_field_select_icon__selected_marker'
), '<i class="ssi_16 ssi_16--check"></i>'));
$html .= Html::closeTag('div');
$html .= parent::fetchElement();
Js::addInline('new _N2.FormElementSelectIcon("' . $this->fieldID . '", ' . json_encode(array()) . ');');