# shiftcontroller/4.9.85/hc3/ui/element/input/number.php

ShiftController Employee Shift Scheduling, version 4.9.85. 43 lines.

- Page: https://pluginprobe.com/plugins/shiftcontroller/4.9.85/code/hc3/ui/element/input/number.php
- Raw: https://pluginprobe.com/plugins/shiftcontroller/4.9.85/raw/hc3/ui/element/input/number.php
- Modified: 2024-12-09T07:03:26+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/shiftcontroller/4.9.85/code/hc3/ui/element/input/number.php#L10-L20`.

```php
<?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
class HC3_Ui_Element_Input_Number extends HC3_Ui_Abstract_Input
{
	protected $el = 'input';
	protected $uiType = 'input/number';

	public function render()
	{
		$out = $this->htmlFactory->makeElement('input')
			->addAttr('type', 'number' )
			->addAttr('name', $this->htmlName() )
			->addAttr('class', 'hc-field')
			// ->addAttr('class', 'hc-block')
			// ->addAttr('class', 'hc-full-width')
			;

		if( strlen($this->value) ){
			$out->addAttr('value', $this->value);
		}

		$attr = $this->getAttr();
		foreach( $attr as $k => $v ){
			$out->addAttr( $k, $v );
		}

		$out->addAttr('id', $this->htmlId());

		if( (null !== $this->label) && strlen($this->label) ){
			$placeHolder = $this->label;
			$placeHolder = strip_tags( $placeHolder );

			$out
				->addAttr('placeholder', $placeHolder)
				;
		}

		if( (null !== $this->label) && strlen($this->label) ){
			$out = $this->htmlFactory->makeLabelled( $this->label, $out, $this->htmlId() );
		}

		return $out;
	}
}
```
