class) ? ' class="radio ' . $this->class . '"' : ' class="radio"'; $required = $this->required ? ' required aria-required="true"' : ''; $autofocus = $this->autofocus ? ' autofocus' : ''; $disabled = $this->disabled ? ' disabled' : ''; $readonly = $this->readonly; // 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) || ($readonly && !$checked); $disabled = $disabled ? ' disabled' : ''; // Initialize some JavaScript option attributes. $onclick = !empty($option->onclick) ? ' onclick="' . $option->onclick . '"' : ''; $onchange = !empty($option->onchange) ? ' onchange="' . $option->onchange . '"' : ''; $html[] = ''; $html[] = ''; $required = ''; } // End the radio field output. $html[] = '
'; return implode($html); } }