: 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 Decoration extends AbstractFieldHidden {
protected $options = array(
'italic' => 'ssi_16 ssi_16--italic',
'underline' => 'ssi_16 ssi_16--underline'
protected function fetchElement() {
$this->value = explode('||', $this->getValue());
$html = Html::tag('div', array(
'class' => 'n2_field_decoration',
), $this->renderOptions() . parent::fetchElement());
Js::addInline('new _N2.FormElementDecoration("' . $this->fieldID . '", ' . json_encode(array_keys($this->options)) . ');');
protected function renderOptions() {
$length = count($this->options) - 1;
foreach ($this->options as $value => $class) {
$html .= Html::tag('div', array(
'class' => 'n2_field_decoration__option ' . ($this->isSelected($value) ? ' n2_field_decoration__option--selected' : ''),
), Html::tag('i', array('class' => $class)));
function isSelected($value) {
if (in_array($value, $this->value)) {
public function setOptions($options) {
$this->options = $options;
public function setStyle($style) {