| 1 | <?php |
||
| 17 | class InputElement extends AbstractElement |
||
| 18 | { |
||
| 19 | /** @var string */ |
||
| 20 | protected $type = 'text'; |
||
| 21 | /** @var array */ |
||
| 22 | private $availableInputTypes = [ |
||
| 23 | 'color', |
||
| 24 | 'date', |
||
| 25 | 'datetime', |
||
| 26 | 'datetime-local', |
||
| 27 | 'email', |
||
| 28 | 'image', |
||
| 29 | 'month', |
||
| 30 | 'number', |
||
| 31 | 'range', |
||
| 32 | 'search', |
||
| 33 | 'tel', |
||
| 34 | 'text', |
||
| 35 | 'time', |
||
| 36 | 'url', |
||
| 37 | 'week', |
||
| 38 | ]; |
||
| 39 | |||
| 40 | /** |
||
| 41 | * SelectElement constructor. |
||
| 42 | * |
||
| 43 | * @param string $name |
||
| 44 | * @param string $label |
||
| 45 | * @param mixed $value |
||
| 46 | */ |
||
| 47 | 5 | public function __construct($name = '', $label = '', $value = null) |
|
| 53 | |||
| 54 | /** |
||
| 55 | * Resets the object when cloning. |
||
| 56 | */ |
||
| 57 | 1 | public function __clone() |
|
| 63 | |||
| 64 | /** |
||
| 65 | * Sets input element type. |
||
| 66 | * |
||
| 67 | * @param string $type |
||
| 68 | * @return InputElement |
||
| 69 | */ |
||
| 70 | 1 | public function setType($type = 'text') |
|
| 78 | } |
||
| 79 |