| Total Complexity | 4 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 87.5% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 3 | class Nip_Form_Renderer_Elements_Radio extends Nip_Form_Renderer_Elements_Input_Abstract |
||
| 4 | { |
||
| 5 | /** |
||
| 6 | * @return string |
||
| 7 | */ |
||
| 8 | 3 | public function generateElement() |
|
| 9 | { |
||
| 10 | 3 | $this->getElement()->addClass('form-check-input'); |
|
| 11 | |||
| 12 | 3 | $class = get_class($this->getRenderer()) == Nip_Form_Renderer_Bootstrap::class ? 'radio' : 'form-check'; |
|
| 13 | 3 | $return = '<div class="' . $class . '">'; |
|
| 14 | 3 | $return .= '<label class="form-check-label">'; |
|
| 15 | 3 | $return .= parent::generateElement(); |
|
| 16 | 3 | $return .= $this->getElement()->getLabel(); |
|
| 17 | 3 | $return .= '</label>'; |
|
| 18 | 3 | $return .= '</div>'; |
|
| 19 | |||
| 20 | 3 | return $return; |
|
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @return string |
||
| 25 | */ |
||
| 26 | public function renderInput() |
||
| 27 | { |
||
| 28 | return parent::generateElement(); |
||
| 29 | } |
||
| 30 | |||
| 31 | 3 | public function getelementattribs() |
|
| 37 | } |
||
| 38 | } |
||
| 39 |