TbHtml::radioButtonListControlGroup PHP Method

radioButtonListControlGroup() public static method

Generates a control group with a radio button list.
See also: self::controlGroup
public static radioButtonListControlGroup ( string $name, string $select = '', array $data = [], array $htmlOptions = [] ) : string
$name string the input name.
$select string the selected value.
$data array data for generating the list options (value=>display).
$htmlOptions array additional HTML attributes.
return string the generated control group.
    public static function radioButtonListControlGroup($name, $select = '', $data = array(), $htmlOptions = array())
    {
        return self::controlGroup(self::INPUT_TYPE_RADIOBUTTONLIST, $name, $select, $htmlOptions, $data);
    }

Usage Example

Exemplo n.º 1
0
 public function testRadioButtonListControlGroup()
 {
     $I = $this->codeGuy;
     $html = TbHtml::radioButtonListControlGroup('radioList', '1', array('Option 1', 'Option 2', 'Option 3'));
     $group = $I->createNode($html, 'div.control-group');
     $controls = $group->filter('div.controls');
     $I->seeNodeChildren($controls, array('label.radio', 'label.radio', 'label.radio'));
 }
TbHtml