Generates a control group with a radio button list for a model attribute.
public static activeRadioButtonListControlGroup ( CModel $model, string $attribute, array $data = [], array $htmlOptions = [] ) : string | ||
$model | CModel | the data model. |
$attribute | string | the attribute. |
$data | array | data for generating the list options (value=>display). |
$htmlOptions | array | additional HTML attributes. |
리턴 | string | the generated control group. |
public function testActiveRadioButtonListControlGroup() { $I = $this->codeGuy; $html = TbHtml::activeRadioButtonListControlGroup(new Dummy(), 'radioList', array('Option 1', 'Option 2', 'Option 3')); $group = $I->createNode($html, 'div.control-group'); $controls = $group->filter('div.controls'); $I->seeNodeChildren($controls, array('input[type=hidden]', 'label.radio', 'label.radio', 'label.radio')); }
/** * Generates a control group with a radio button list for a model attribute. * @param CModel $model the data model. * @param string $attribute the attribute name. * @param array $data data for generating the list options (value=>display). * @param array $htmlOptions additional HTML attributes. * @return string the generated row. * @see TbHtml::activeRadioButtonListControlGroup */ public function radioButtonListControlGroup($model, $attribute, $data, $htmlOptions = array()) { $htmlOptions = $this->processRowOptions($model, $attribute, $htmlOptions); return TbHtml::activeRadioButtonListControlGroup($model, $attribute, $data, $htmlOptions); }