: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace Nextend\Framework\Form\Element\Text;
use Nextend\Framework\Asset\Js\Js;
use Nextend\Framework\Form\Element\Text;
use Nextend\Framework\View\Html;
class Number extends Text {
protected $class = 'n2_field_number ';
protected $sublabel = '';
protected $units = false;
protected function fetchElement() {
if ($this->min === false) {
$this->min = '-Number.MAX_VALUE';
if ($this->max === false) {
$this->max = 'Number.MAX_VALUE';
$this->renderRelatedFields();
$html = Html::openTag('div', array(
'class' => 'n2_field_text ' . $this->getClass()
if (!empty($this->sublabel)) {
$html .= Html::tag('div', array(
'class' => 'n2_field_text__pre_label'
$html .= Html::tag('input', array(
'type' => $this->fieldType,
'name' => $this->getFieldName(),
'value' => $this->getValue(),
'style' => $this->getStyle(),
$html .= Html::tag('div', array(
'class' => 'n2_field_number__unit'
protected function addScript() {
Js::addInline('new _N2.FormElementNumber("' . $this->fieldID . '", ' . $this->min . ', ' . $this->max . ', ' . json_encode($this->units) . ');');
public function setMin($min) {
public function setMax($max) {
* @param string $sublabel
public function setSublabel($sublabel) {
$this->sublabel = $sublabel;
* @param bool|array $units
public function setUnits($units) {
public function setWide($wide) {
$this->style .= 'width:20px;';
$this->style .= 'width:26px;';
$this->style .= 'width:32px;';
$this->style .= 'width:44px;';
$this->style .= 'width:60px;';