Total Complexity | 9 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 1 | Features | 1 |
1 | <?php |
||
7 | class Input extends FormElement |
||
8 | { |
||
9 | /** @var string */ |
||
10 | public $type = 'text'; |
||
11 | |||
12 | /** @var string */ |
||
13 | public $placeholder; |
||
14 | |||
15 | protected function attributesList() |
||
16 | { |
||
17 | return [ |
||
18 | 'id', 'name', 'type', 'placeholder', 'value', 'class', 'required', 'disabled', 'readonly', 'autocomplete', |
||
19 | ]; |
||
20 | } |
||
21 | |||
22 | protected function setSpecificAttributes() |
||
23 | { |
||
24 | $this->setPlaceholder(); |
||
25 | $this->setType(); |
||
26 | } |
||
27 | |||
28 | protected function setPlaceholder() |
||
29 | { |
||
30 | if (isset($this->params['placeholder']) && ! empty($this->params['placeholder'])) { |
||
31 | $this->placeholder = $this->params['placeholder']; |
||
32 | } |
||
33 | } |
||
34 | |||
35 | protected function setType() |
||
39 | } |
||
40 | } |
||
41 | |||
42 | protected function setDefaultClass() |
||
47 |