: 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 Unit extends AbstractFieldHidden {
protected $units = array();
protected function fetchElement() {
$html = "<div class='n2_field_unit' style='" . $this->style . "'>";
$currentValue = $this->getValue();
$html .= Html::openTag('div', array(
'class' => 'n2_field_unit__units'
foreach ($this->units as $unit) {
$html .= Html::tag('div', array(
'class' => 'n2_field_unit__unit'
if ($currentValue == $unit) {
$html .= Html::tag('div', array(
'class' => 'n2_field_unit__current_unit'
$html .= parent::fetchElement();
Js::addInline('new _N2.FormElementUnits("' . $this->fieldID . '", ' . json_encode($values) . ');');
public function setStyle($style) {
public function setUnits($units) {