Adds a radio button in this group and returns it.

@return Radio
3933
public function addRadio() : Radio
    {
        $radio = new Radio($this->form, $this->name);
        $radio->setRequired($this->isRequired());
        $this->radios[] = $radio;

        return $radio;
    }
507264
protected function getGroups()
	{
		$groups = array();
		$label = 0;

		foreach ($this->element->children() as $element)
		{
			switch ($element->getName())
			{
				// The element is an <option />
				case 'option':
					// Initialize the group if necessary.
					if (!isset($groups[$label]))
					{
						$groups[$label] = array();
					}

					// Create a new option object based on the <option /> element.
					$tmp = HtmlSelect::option(
						($element['value']) ? (string) $element['value'] : trim((string) $element),
						Text::alt(trim((string) $element), preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname)), 'value', 'text',
						((string) $element['disabled'] == 'true')
					);

					// Set some option attributes.
					$tmp->class = (string) $element['class'];

					// Set some JavaScript option attributes.
					$tmp->onclick = (string) $element['onclick'];

					// Add the option.
					$groups[$label][] = $tmp;
					break;

				// The element is a <group />
				case 'group':
					// Get the group label.
					if ($groupLabel = (string) $element['label'])
					{
						$label = Text::_($groupLabel);
					}

					// Initialize the group if necessary.
					if (!isset($groups[$label]))
					{
						$groups[$label] = array();
					}

					// Iterate through the children and build an array of options.
					foreach ($element->children() as $option)
					{
						// Only add <option /> elements.
						if ($option->getName() != 'option')
						{
							continue;
						}

						// Create a new option object based on the <option /> element.
						$tmp = HtmlSelect::option(
							($option['value']) ? (string) $option['value'] : Text::_(trim((string) $option)),
							Text::_(trim((string) $option)), 'value', 'text', ((string) $option['disabled'] == 'true')
						);

						// Set some option attributes.
						$tmp->class = (string) $option['class'];

						// Set some JavaScript option attributes.
						$tmp->onclick = (string) $option['onclick'];

						// Add the option.
						$groups[$label][] = $tmp;
					}

					if ($groupLabel)
					{
						$label = count($groups);
					}
					break;

				// Unknown element type.
				default:
					throw new UnexpectedValueException(sprintf('Unsupported element %s in JFormFieldGroupedList', $element->getName()), 500);
			}
		}

		reset($groups);

		return $groups;
	}
78327
public static <T> RadioGroup<T> newRadioGroup(final String id, final IModel<T> model)
	{
		final RadioGroup<T> radioGroup = new RadioGroup<>(id, model);
		radioGroup.setOutputMarkupId(true);
		return radioGroup;
	}
679811
public function selectButtonByValue($value)
	{
		/** @var $button RadioButton */
		foreach ( $this as $button ) {
			if ( (string)$button->getValue() === (string)$value ) {
				$button->select();

				return $this;
			}
		}

		throw new RadioGroupException(
			'Cannot locate radio button with value: ' . $value,
			RadioGroupException::TYPE_NOT_FOUND
		);
	}
803966
public function getHtml(): string
  {
    $this->attributes['type'] = 'radio';
    $this->attributes['name'] = $this->submitName;

    // A radio button is checked if and only if its value equals to the value of attribute value.
    if (isset($this->attributes['value']) &&
      (Cast::toManString($this->value, '')===Cast::toManString($this->attributes['value'], '')))
    {
      $this->attributes['checked'] = true;
    }
    else
    {
      unset($this->attributes['checked']);
    }

    $ret = $this->prefix;
    $ret .= $this->getHtmlPrefixLabel();
    $ret .= Html::generateVoidElement('input', $this->attributes);
    $ret .= $this->getHtmlPostfixLabel();
    $ret .= $this->postfix;

    return $ret;
  }
1131819
public function addGroup($label = null)
    {
        if (!is_array($label)) {
            $label = ['label' => $label];
        } elseif (isset($label[0])) {
            $label['label'] = $label[0];
            unset($label[0]);
        }

        $label['form'] = $this->form;

        return $this->add(new static($label));
    }
1209749
public function &addGroup($unshift = false)
    {
        $group = $this->factory->create('FormDesigner\FormGroup');

        if ($unshift == true) {
            array_unshift($this->groups, $group);
        }
        else {
            $this->groups[] = $group;
        }

        $group->injectFormDesigner($this);

        return $group;
    }
503926
public function add()
    {
        $args = func_get_args();
        foreach( $args as $arg ) {
            if( is_array($arg) ) {
                foreach( $arg as $value ) {
                    $this[] = $value;
                }
            } else {
                $this[] = $arg;
            }
        }
        return $this;
    }
80368
public function addToOtherGroup($element)
    {
        if ($element instanceof \Zend_Form_Element) {
            if ($group = $this->getDisplayGroup(self::GROUP_OTHER)) {
                $group->addElement($element);
            } else  {
                $this->addDisplayGroup(array($element), self::GROUP_OTHER);
            }
        }
        return $this;
    }
158967
public function addGroup($group)
    {
        if (null === $this->groups) {
            $this->groups = [];
        }
        if (!in_array($group, $this->groups)) {
            $this->groups[] = $group;
        }

        return $this;
    }
604692
public function AddNewForm()
    {
        $action    = FormAction::create('doAddNew', _t('QUICKADDNEW.Add', 'Add'))->setUseButtonTag('true');

        if (!$this->isFrontend) {
            $action->addExtraClass('ss-ui-action-constructive')->setAttribute('data-icon', 'accept');
        }

        $actions = FieldList::create($action);
        $form = Form::create($this->owner, 'AddNewForm', $this->addNewFields, $actions, $this->addNewRequiredFields);

        $this->owner->extend('updateQuickAddNewForm', $form);

        return $form;
    }
1307461
private function OptionsString()
    {
        if (!$this->radio->Exists())
        {
            return '';
        }
        $list = new RadioListProvider($this->radio);
        $options = $list->ToArray();
        $lines = array();
        foreach ($options as $key=>$value)
        {
            $lines[] = $key . ':' . $value;
        }
        return join("\r\n", $lines);
    }
451157
public function selectButtonByLabelText($text)
	{
		/** @var $button RadioButton */
		foreach ( $this as $button ) {
			if ( strpos($button->getLabelText(), $text) !== false ) {
				$button->select();

				return $this;
			}
		}

		throw new RadioGroupException(
			'Cannot locate radio button with label text containing: ' . $text,
			RadioGroupException::TYPE_NOT_FOUND
		);
	}
285513
protected function getGroups()
	{
		$groups = array();
		$label = 0;

		$select = new HtmlSelect;

		// Try to inject the text object into the field
		try
		{
			$select->setText($this->getText());
		}
		catch (\RuntimeException $exception)
		{
			// A Text object was not set, ignore the error and try to continue processing
		}

		/** @var \SimpleXMLElement $element */
		foreach ($this->element->children() as $element)
		{
			switch ($element->getName())
			{
				// The element is an <option />
				case 'option':
					// Initialize the group if necessary.
					if (!isset($groups[$label]))
					{
						$groups[$label] = array();
					}

					// Create a new option object based on the <option /> element.
					$tmp = $select->option(
						($element['value']) ? (string) $element['value'] : trim((string) $element),
						$this->getText()->alt(trim((string) $element), preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname)), 'value', 'text',
						((string) $element['disabled'] == 'true')
					);

					// Set some option attributes.
					$tmp->class = (string) $element['class'];

					// Set some JavaScript option attributes.
					$tmp->onclick = (string) $element['onclick'];

					// Add the option.
					$groups[$label][] = $tmp;
					break;

				// The element is a <group />
				case 'group':
					// Get the group label.
					if ($groupLabel = (string) $element['label'])
					{
						$label = $this->translateLabel ? $this->getText()->translate($groupLabel) : $groupLabel;
					}

					// Initialize the group if necessary.
					if (!isset($groups[$label]))
					{
						$groups[$label] = array();
					}

					// Iterate through the children and build an array of options.
					/** @var \SimpleXMLElement $option */
					foreach ($element->children() as $option)
					{
						// Only add <option /> elements.
						if ($option->getName() != 'option')
						{
							continue;
						}

						// Create a new option object based on the <option /> element.
						$tmp = $select->option(
							($option['value']) ? (string) $option['value'] : $this->getText()->translate(trim((string) $option)),
							$this->getText()->translate(trim((string) $option)), 'value', 'text', ((string) $option['disabled'] == 'true')
						);

						// Set some option attributes.
						$tmp->class = (string) $option['class'];

						// Set some JavaScript option attributes.
						$tmp->onclick = (string) $option['onclick'];

						// Add the option.
						$groups[$label][] = $tmp;
					}

					if ($groupLabel)
					{
						$label = count($groups);
					}
					break;

				// Unknown element type.
				default:
					throw new \UnexpectedValueException(
						sprintf('Unsupported element %1$s in %2$s', $element->getName(), __CLASS__),
						500
					);
			}
		}

		reset($groups);

		return $groups;
	}
533121
protected Radio<T> newRadio(String wicketId, IModel<T> model, RadioGroup<T> group)
	{
		Radio<T> radio = new Radio<T>(wicketId, model, group);
		return radio;
	}
610959
public function radio($options = []){
        if (is_string($options)) {
            $options = ['class' => $options];
        }elseif(is_bool($options)){
            $options = [
                'checked' => 'checked'
            ];
        }

        if (!Arr::has($options, 'type')) {
            Arr::set($options, 'type', 'radio');
        }

        return $this->input($options);
    }
124302
public function radio($config = array())
    {
        $config = new KObjectConfigJson($config);
        $config->append(array(
            'entity'  		=> null,
            'attribs' => array()
        ));

        if($config->entity->isLockable() && $config->entity->isLocked())
        {
            $html = $this->getTemplate()->helper('behavior.tooltip');
            $html .= '<span class="k-icon-lock-locked"
                            data-k-tooltip 
                            title="'.$this->getTemplate()->helper('grid.lock_message', array('entity' => $config->entity)).'">
                    </span>';
        }
        else
        {
            $column = $config->entity->getIdentityColumn();
            $value  = $this->getTemplate()->escape($config->entity->{$column});

            $attribs = $this->buildAttributes($config->attribs);

            $html = '<input type="radio" class="k-js-grid-checkbox" name="%s[]" value="%s" %s />';
            $html = sprintf($html, $column, $value, $attribs);
        }

        return $html;
    }