radio_box
Github

    public function radio_box()
    {
        return _class('html')->radio_box('input_name', ['k1' => 'key1', 'k2' => 'key2']);
    }
    public function radio_box($name, $values = [], $selected = '', $horizontal = true, $type = 2, $add_str = '', $translate = 0)
    {
        if (is_array($name)) {
            $extra = (array) $extra + $name;
            $name = $extra['name'];
        }
        $values = isset($extra['values']) ? $extra['values'] : (array) $values; // Required
        $translate = isset($extra['translate']) ? $extra['translate'] : $translate;
        if ($extra['no_translate']) {
            $translate = 0;
        }
        $selected = isset($extra['selected']) ? $extra['selected'] : $selected;
        $type = isset($extra['type']) ? $extra['type'] : ($type !== null ? $type : 2);
        $horizontal = isset($extra['horizontal']) ? $extra['horizontal'] : $horizontal;
        $add_str = isset($extra['add_str']) ? $extra['add_str'] : $add_str;
        if ($extra['class_add']) {
            $add_str .= ' class="' . trim($extra['class'] . ' ' . $extra['class_add']) . '" ';
        }
        if ($extra['style']) {
            $add_str .= ' style="' . $extra['style'] . '" ';
        }
        if ( ! $values) {
            return false;
        }
        $selected = (string) $selected;
        $id_prefix = __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
        $extra['force_id'] && $id_prefix = $extra['force_id'];
        $counter = 0;
        $body = [];
        if ($extra['outer_label']) {
            $body[] = '<label class="outer-label">' . $extra['outer_label'] . '</label>';
        }
        $orig_extra = $extra;
        $use_stpl = isset($extra['use_stpl']) ? $extra['use_stpl'] : $this->BOXES_USE_STPL;
        foreach ((array) $values as $value => $val_name) {
            $label_extra_class = '';
            if (is_array($val_name)) {
                $extra = (array) $orig_extra + (array) $val_name['extra'];
                $label_extra_class = $val_name['class'];
                $val_name = $val_name['html'];
            }
            $is_selected = ((string) ($type == 1 ? $val_name : $value) == $selected);
            $id = $id_prefix . '_' . ++$counter;
            if ($use_stpl) {
                $body[] = tpl()->parse('system/common/radio_box_item', [
                    'name' => $name,
                    'value' => $value,
                    'selected' => $is_selected ? 'checked="checked"' : '',
                    'add_str' => $add_str,
                    'label' => $translate ? t($val_name) : $val_name,
                    'horizontal' => (int) ((bool) $horizontal),
                    'id' => $id,
                    'extra' => $extra,
                ]);
            } else {
                $label_extra = $extra['label_extra'];
                $label_extra['class'] = ($label_extra_class ?: $label_extra['class'] ?: $this->CLASS_LABEL_RADIO) . ($horizontal ? ' ' . $this->CLASS_LABEL_RADIO_INLINE : '');
                if ($extra['class_add_label_radio']) {
                    $label_extra['class'] .= ' ' . $extra['class_add_label_radio'];
                }
                if ($is_selected) {
                    $label_extra['class'] .= ' ' . $this->CLASS_LABEL_RADIO_SELECTED;
                }
                $body[] =
                    '<label' . _attrs($label_extra, ['id', 'class', 'style']) . '>'
                    . '<input type="radio" name="' . $name . '" id="' . $id . '" value="' . $value . '"' . ($add_str ? ' ' . trim($add_str) : '') . ($is_selected ? ' checked="checked"' : '') . '>'
                    . '<span>' . t($val_name) . '</span>'
                    . '</label>' . PHP_EOL;
            }
        }
        return implode(PHP_EOL, $body);
    }