coordinates ? 'wizard' : ''; if (! $this->multiple || ! $this->size) { $this->size = 1; } else { $wrapperClass .= ' wizard_' . $this->size; } if (! is_array($this->value)) { $this->value = [$this->value]; } $buffer = ''; for ($index = 0; $index < $this->size; $index++) { $template = new BackendTemplate($this->widgetTemplate); $template->setData( [ 'wrapperClass' => trim($wrapperClass), 'widget' => $this, 'value' => StringUtil::specialchars($this->value[$index]), 'class' => $this->strClass ? ' ' . $this->strClass : '', 'id' => $this->strId . ($this->size > 1 ? '_' . $index : ''), 'name' => $this->strName . ($this->size > 1 ? '[]' : ''), 'attributes' => $this->getAttributes(), 'wizard' => $this->wizard, 'label' => $this->strLabel, 'coordinates' => $this->coordinates, ] ); $buffer .= $template->parse(); } return $buffer; } /** * {@inheritdoc} */ protected function validator($varInput) { if (is_numeric($varInput) && $this->steps > 0) { $steps = (int) $this->steps; $varInput = (int) $varInput; $varInput = $steps * round($varInput / $steps); } return parent::validator($varInput); } }