helpers/TbHtml.php
public static function activeCheckBoxList($model, $attribute, $data, $htmlOptions = array())
    {
        parent::resolveNameID($model, $attribute, $htmlOptions);
        $selection = parent::resolveValue($model, $attribute);
        if ($model->hasErrors($attribute)) {
            parent::addErrorCss($htmlOptions);
        }
        $name = TbArray::popValue('name', $htmlOptions);
        $uncheckValue = TbArray::popValue('uncheckValue', $htmlOptions, '');
        $hiddenOptions = isset($htmlOptions['id']) ? array('id' => parent::ID_PREFIX . $htmlOptions['id']) : array('id' => false);
        $hidden = $uncheckValue !== null ? parent::hiddenField($name, $uncheckValue, $hiddenOptions) : '';
        return $hidden . self::checkBoxList($name, $selection, $data, $htmlOptions);
    }
public static function activeCheckBoxList($model, $attribute, $data, $htmlOptions = array())
    {
        parent::resolveNameID($model, $attribute, $htmlOptions);
        $selection = parent::resolveValue($model, $attribute);
        if ($model->hasErrors($attribute)) {
            parent::addErrorCss($htmlOptions);
        }
        $name = TbArray::popValue('name', $htmlOptions);
        $uncheckValue = TbArray::popValue('uncheckValue', $htmlOptions, '');
        $hiddenOptions = isset($htmlOptions['id']) ? array('id' => parent::ID_PREFIX . $htmlOptions['id']) : array('id' => false);
        $hidden = $uncheckValue !== null ? parent::hiddenField($name, $uncheckValue, $hiddenOptions) : '';
        return $hidden . self::checkBoxList($name, $selection, $data, $htmlOptions);
    }
public static function activeCheckBoxList ( $ model , $ attribute , $ data , $ htmlOptions = array ( ) ) { parent :: resolveNameID ( $ model , $ attribute , $ htmlOptions ) ; $ selection = parent :: resolveValue ( $ model , $ attribute ) ; if ( $ model -> hasErrors ( $ attribute ) ) { parent :: addErrorCss ( $ htmlOptions ) ; } $ name = TbArray :: popValue ( 'name' , $ htmlOptions ) ; $ uncheckValue = TbArray :: popValue ( 'uncheckValue' , $ htmlOptions , '' ) ; $ hiddenOptions = isset ( $ htmlOptions [ 'id' ] ) ? array ( 'id' => parent :: ID_PREFIX . $ htmlOptions [ 'id' ] ) : array ( 'id' => false ) ; $ hidden = $ uncheckValue !== null ? parent :: hiddenField ( $ name , $ uncheckValue , $ hiddenOptions ) : '' ; return $ hidden . self :: checkBoxList ( $ name , $ selection , $ data , $ htmlOptions ) ; }
Generates a check box list for a model attribute.
@param CModel $model the data model.
@param string $attribute the attribute.
@param array $data $data value-label pairs used to generate the check box list.
@param array $htmlOptions additional HTML attributes.
@return string the generated list.
Generates a check box list for a model attribute .