Conditions | 4 |
Paths | 6 |
Total Lines | 25 |
Code Lines | 19 |
Lines | 25 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
16 | public function draw() { |
||
17 | $inputName = $this->colName(); |
||
18 | $inputLabel = $this->colLabel(); |
||
19 | |||
20 | $inputOptions = $this->options; |
||
21 | if (!empty($inputOptions['minDate'])) { |
||
22 | if (strpos($inputOptions['minDate'], 'col:') === 0) { |
||
23 | $colName = substr($inputOptions['minDate'], 4); |
||
24 | $inputOptions['minDate'] = $this->activeForm->model->{$colName}; |
||
25 | } |
||
26 | } |
||
27 | $inputOptions['value'] = $this->value(); |
||
28 | $inputOptions['disabled'] = $this->readOnly(); |
||
29 | |||
30 | $preset = $this->preset(); |
||
31 | if ($preset !== null) { |
||
32 | $inputOptions['disabled'] = true; |
||
33 | $this->form->input('hidden', $inputName, '', $inputOptions); |
||
34 | return true; |
||
35 | } |
||
36 | $classPath = explode('\\', get_called_class()); |
||
37 | $inputType = lcfirst(array_pop($classPath)); |
||
38 | $this->form->input($inputType, $inputName, $inputLabel, $inputOptions); |
||
39 | return true; |
||
40 | } |
||
41 | } |