public function spin($fieldName, $options = []) {
		if (!is_array($options)) {
			$options = [];
		}
		$defaultOptions = $this->_getOptionsForElem('spin.defaultOpt');
		$options = $defaultOptions + $options;
		$listExtraOptions = $this->_getOptionsForElem('spin.extraOpt');
		$this->_prepareExtraOptions($options, $listExtraOptions, 'data-spin-');
		$numbers = '';
		$decimals = '';
		if (isset($options['data-spin-max']) && !empty($options['data-spin-max'])) {
			$numbers = mb_strlen($options['data-spin-max']);
		}
		if (isset($options['data-spin-decimals']) && !empty($options['data-spin-decimals'])) {
			$decimals = (int)$options['data-spin-decimals'];
		}

		$options['data-inputmask-mask'] = '9{1,' . $numbers . '}';
		if (!empty($decimals)) {
			$options['data-inputmask-mask'] .= '.9{' . $decimals . '}';
		}

		return $this->text($fieldName, $options);
	}
public function spin($fieldName, $options = []) {
		if (!is_array($options)) {
			$options = [];
		}
		$defaultOptions = $this->_getOptionsForElem('spin.defaultOpt');
		$options = $defaultOptions + $options;
		$listExtraOptions = $this->_getOptionsForElem('spin.extraOpt');
		$this->_prepareExtraOptions($options, $listExtraOptions, 'data-spin-');
		$numbers = '';
		$decimals = '';
		if (isset($options['data-spin-max']) && !empty($options['data-spin-max'])) {
			$numbers = mb_strlen($options['data-spin-max']);
		}
		if (isset($options['data-spin-decimals']) && !empty($options['data-spin-decimals'])) {
			$decimals = (int)$options['data-spin-decimals'];
		}

		$options['data-inputmask-mask'] = '9{1,' . $numbers . '}';
		if (!empty($decimals)) {
			$options['data-inputmask-mask'] .= '.9{' . $decimals . '}';
		}

		return $this->text($fieldName, $options);
	}
public function spin ( $ fieldName , $ options = [ ] ) { if ( ! is_array ( $ options ) ) { $ options = [ ] ; } $ defaultOptions = $ this -> _getOptionsForElem ( 'spin.defaultOpt' ) ; $ options = $ defaultOptions + $ options ; $ listExtraOptions = $ this -> _getOptionsForElem ( 'spin.extraOpt' ) ; $ this -> _prepareExtraOptions ( $ options , $ listExtraOptions , 'data-spin-' ) ; $ numbers = '' ; $ decimals = '' ; if ( isset ( $ options [ 'data-spin-max' ] ) && ! empty ( $ options [ 'data-spin-max' ] ) ) { $ numbers = mb_strlen ( $ options [ 'data-spin-max' ] ) ; } if ( isset ( $ options [ 'data-spin-decimals' ] ) && ! empty ( $ options [ 'data-spin-decimals' ] ) ) { $ decimals = ( int ) $ options [ 'data-spin-decimals' ] ; } $ options [ 'data-inputmask-mask' ] = '9{1,' . $ numbers . '}' ; if ( ! empty ( $ decimals ) ) { $ options [ 'data-inputmask-mask' ] .= '.9{' . $ decimals . '}' ; } return $ this -> text ( $ fieldName , $ options ) ; }
Creates a touch spin input widget.

### Options:

- `min` - Minimum value;
- `max` - Maximum value;
- `step` - Incremental/decremental step on up/down change;
- `decimals` - Number of decimal points;
- `maxboostedstep` - Maximum step when boosted;
- `verticalbuttons` - Enables the traditional up/down buttons;
- `prefix` - Text before the input;
- `prefix_extraclass` - Extra class(es) for prefix;
- `postfix` - Text after the input;
- `postfix_extraclass` - Extra class(es) for postfix.

@param string $fieldName Name of a field, like this "Modelname.fieldname"
@param array $options Array of HTML attributes.
@return string An HTML text input element.
@see {@link http://www.virtuosoft.eu/code/bootstrap-touchspin} TouchSpin
Creates a touch spin input widget .