TbHtml::activeCheckBoxControlGroup PHP Method

activeCheckBoxControlGroup() public static method

Generates a control group with a check box for a model attribute.
See also: self::activeControlGroup
public static activeCheckBoxControlGroup ( CModel $model, string $attribute, array $htmlOptions = [] ) : string
$model CModel the data model
$attribute string the attribute.
$htmlOptions array additional HTML attributes.
return string the generated control group.
    public static function activeCheckBoxControlGroup($model, $attribute, $htmlOptions = array())
    {
        return self::activeControlGroup(self::INPUT_TYPE_CHECKBOX, $model, $attribute, $htmlOptions);
    }

Usage Example

Example #1
0
 public function testActiveCheckBoxControlGroup()
 {
     $I = $this->codeGuy;
     $html = TbHtml::activeCheckBoxControlGroup(new Dummy(), 'checkbox');
     $group = $I->createNode($html, 'div.control-group');
     $I->seeNodeChildren($group, array('input[type=hidden]', 'label.checkbox'));
     $label = $group->filter('label.checkbox');
     $I->seeNodeChildren($label, array('input[type=checkbox]'));
 }
All Usage Examples Of TbHtml::activeCheckBoxControlGroup
TbHtml