Conditions | 3 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | public function render() { |
||
17 | $html = ''; |
||
18 | $currentValue = $this->getValue(); |
||
19 | $attributes = $this->attributes; |
||
20 | $attributes['type'] = 'radio'; |
||
21 | |||
22 | foreach ($this->options as $value => $text) { |
||
23 | $attributes['value'] = $value; |
||
24 | if ($currentValue == $value) { |
||
25 | $attributes['checked'] = 'checked'; |
||
26 | } else { |
||
27 | unset($attributes['checked']); |
||
28 | } |
||
29 | |||
30 | $html .= '<label>' . static::tag('input', $attributes) . $text . '</label>'; |
||
31 | } |
||
32 | |||
33 | return $html; |
||
34 | } |
||
35 | } |