element['class'] ? ' class="radio ' . (string) $this->element['class'] . '"' : ' class="radio"'; // Start the radio field output. $html[] = '
'; // Get the field options. $options = $this->getOptions(); // Build the radio field output. foreach ($options as $i => $option) { // Initialize some option attributes. $checked = ((string) $option->value == (string) $this->value) ? ' checked="checked"' : ''; $class = !empty($option->class) ? ' class="' . $option->class . '"' : ''; $disabled = !empty($option->disable) ? ' disabled="disabled"' : ''; $required = !empty($option->required) ? ' required="required" aria-required="true"' : ''; // Initialize some JavaScript option attributes. $onclick = !empty($option->onclick) ? ' onclick="' . $option->onclick . '"' : ''; $html[] = ''; $html[] = ''; } // End the radio field output. $html[] = '
'; return implode($html); } /** * Method to get the field options for radio buttons. * * @return array The field option objects. * * @since 11.1 */ protected function getOptions() { $options = array(); foreach ($this->element->children() as $option) { // Only add