| @@ 57-67 (lines=11) @@ | ||
| 54 | // build output dom html |
|
| 55 | foreach ($options as $idx => $value) { |
|
| 56 | $property = $this->properties; |
|
| 57 | if ($optionsKey === true) { // radio button as [value => text_description] - values is a key |
|
| 58 | $property['value'] = $idx; |
|
| 59 | if ($idx == $this->value) { |
|
| 60 | $property['checked'] = null; // def boolean attribute html5 |
|
| 61 | } |
|
| 62 | } else { // radio button only with [value] data |
|
| 63 | $property['value'] = $value; |
|
| 64 | if ($value == $this->value) { |
|
| 65 | $property['checked'] = null; // def boolean attribute html5 |
|
| 66 | } |
|
| 67 | } |
|
| 68 | ||
| 69 | // get template and concat avg response |
|
| 70 | $build .= App::$View->render('native/form/radio_list', [ |
|
| @@ 48-57 (lines=10) @@ | ||
| 45 | $buildOpt = null; |
|
| 46 | foreach ($options as $optIdx => $opt) { |
|
| 47 | $optionProperty = []; |
|
| 48 | if ($optionsKey === true) { // options with value => text |
|
| 49 | $optionProperty['value'] = $optIdx; |
|
| 50 | if ($optIdx == $this->value) { |
|
| 51 | $optionProperty['selected'] = null; // def boolean attribute html5 |
|
| 52 | } |
|
| 53 | } else { // only value option |
|
| 54 | if ($opt == $this->value) { |
|
| 55 | $optionProperty['selected'] = null; // def boolean attribute html5 |
|
| 56 | } |
|
| 57 | } |
|
| 58 | $buildOpt .= self::buildContainerTag('option', $optionProperty, $opt); |
|
| 59 | } |
|
| 60 | ||