TbHtml::inlineRadioButtonList PHP Method

inlineRadioButtonList() public static method

Generates an inline radio button list.
public static inlineRadioButtonList ( string $name, mixed $select, array $data, array $htmlOptions = [] ) : string
$name string name of the radio button list.
$select mixed selection of the radio buttons.
$data array $data value-label pairs used to generate the radio button list.
$htmlOptions array additional HTML attributes.
return string the generated list.
    public static function inlineRadioButtonList($name, $select, $data, $htmlOptions = array())
    {
        $htmlOptions['inline'] = true;
        return self::radioButtonList($name, $select, $data, $htmlOptions);
    }

Usage Example

Example #1
0
 public function testInlineRadioButtonList()
 {
     $I = $this->codeGuy;
     $html = TbHtml::inlineRadioButtonList('radioList', null, array('Option 1', 'Option 2', 'Option 3'));
     $span = $I->createNode($html, 'span');
     $I->seeNodeNumChildren($span, 3);
     $I->seeNodeChildren($span, array('label.radio.inline', 'label.radio.inline', 'label.radio.inline'));
 }
TbHtml