public static function activeControlGroup($type, $model, $attribute, $htmlOptions = array(), $data = array())
    {
        $color = TbArray::popValue('color', $htmlOptions);
        $groupOptions = TbArray::popValue('groupOptions', $htmlOptions, array());
        $controlOptions = TbArray::popValue('controlOptions', $htmlOptions, array());
        $label = TbArray::popValue('label', $htmlOptions);
        $labelOptions = TbArray::popValue('labelOptions', $htmlOptions, array());

        if (in_array($type, array(self::INPUT_TYPE_CHECKBOX, self::INPUT_TYPE_RADIOBUTTON))) {
            $htmlOptions['label'] = isset($label) ? $label : $model->getAttributeLabel($attribute);
            $htmlOptions['labelOptions'] = $labelOptions;
            $label = false;
        }
        if (isset($label) && $label !== false) {
            $labelOptions['label'] = $label;
        }

        $help = TbArray::popValue('help', $htmlOptions, '');
        $helpOptions = TbArray::popValue('helpOptions', $htmlOptions, array());
        if (!empty($help)) {
            $help = self::inputHelp($help, $helpOptions);
        }
        $error = TbArray::popValue('error', $htmlOptions, '');

        $input = isset($htmlOptions['input'])
            ? $htmlOptions['input']
            : self::createActiveInput($type, $model, $attribute, $htmlOptions, $data);

        self::addCssClass('control-group', $groupOptions);
        if (!empty($color)) {
            self::addCssClass($color, $groupOptions);
        }
        self::addCssClass('control-label', $labelOptions);
        $output = self::openTag('div', $groupOptions);
        if ($label !== false) {
            $output .= parent::activeLabelEx($model, $attribute, $labelOptions);
        }
        $output .= self::controls($input . $error . $help, $controlOptions);
        $output .= '</div>';
        return $output;
    }
public static function activeControlGroup($type, $model, $attribute, $htmlOptions = array(), $data = array())
    {
        $color = TbArray::popValue('color', $htmlOptions);
        $groupOptions = TbArray::popValue('groupOptions', $htmlOptions, array());
        $controlOptions = TbArray::popValue('controlOptions', $htmlOptions, array());
        $label = TbArray::popValue('label', $htmlOptions);
        $labelOptions = TbArray::popValue('labelOptions', $htmlOptions, array());

        if (in_array($type, array(self::INPUT_TYPE_CHECKBOX, self::INPUT_TYPE_RADIOBUTTON))) {
            $htmlOptions['label'] = isset($label) ? $label : $model->getAttributeLabel($attribute);
            $htmlOptions['labelOptions'] = $labelOptions;
            $label = false;
        }
        if (isset($label) && $label !== false) {
            $labelOptions['label'] = $label;
        }

        $help = TbArray::popValue('help', $htmlOptions, '');
        $helpOptions = TbArray::popValue('helpOptions', $htmlOptions, array());
        if (!empty($help)) {
            $help = self::inputHelp($help, $helpOptions);
        }
        $error = TbArray::popValue('error', $htmlOptions, '');

        $input = isset($htmlOptions['input'])
            ? $htmlOptions['input']
            : self::createActiveInput($type, $model, $attribute, $htmlOptions, $data);

        self::addCssClass('control-group', $groupOptions);
        if (!empty($color)) {
            self::addCssClass($color, $groupOptions);
        }
        self::addCssClass('control-label', $labelOptions);
        $output = self::openTag('div', $groupOptions);
        if ($label !== false) {
            $output .= parent::activeLabelEx($model, $attribute, $labelOptions);
        }
        $output .= self::controls($input . $error . $help, $controlOptions);
        $output .= '</div>';
        return $output;
    }
public static function activeControlGroup ( $ type , $ model , $ attribute , $ htmlOptions = array ( ) , $ data = array ( ) ) { $ color = TbArray :: popValue ( 'color' , $ htmlOptions ) ; $ groupOptions = TbArray :: popValue ( 'groupOptions' , $ htmlOptions , array ( ) ) ; $ controlOptions = TbArray :: popValue ( 'controlOptions' , $ htmlOptions , array ( ) ) ; $ label = TbArray :: popValue ( 'label' , $ htmlOptions ) ; $ labelOptions = TbArray :: popValue ( 'labelOptions' , $ htmlOptions , array ( ) ) ; if ( in_array ( $ type , array ( self :: INPUT_TYPE_CHECKBOX , self :: INPUT_TYPE_RADIOBUTTON ) ) ) { $ htmlOptions [ 'label' ] = isset ( $ label ) ? $ label : $ model -> getAttributeLabel ( $ attribute ) ; $ htmlOptions [ 'labelOptions' ] = $ labelOptions ; $ label = false ; } if ( isset ( $ label ) && $ label !== false ) { $ labelOptions [ 'label' ] = $ label ; } $ help = TbArray :: popValue ( 'help' , $ htmlOptions , '' ) ; $ helpOptions = TbArray :: popValue ( 'helpOptions' , $ htmlOptions , array ( ) ) ; if ( ! empty ( $ help ) ) { $ help = self :: inputHelp ( $ help , $ helpOptions ) ; } $ error = TbArray :: popValue ( 'error' , $ htmlOptions , '' ) ; $ input = isset ( $ htmlOptions [ 'input' ] ) ? $ htmlOptions [ 'input' ] : self :: createActiveInput ( $ type , $ model , $ attribute , $ htmlOptions , $ data ) ; self :: addCssClass ( 'control-group' , $ groupOptions ) ; if ( ! empty ( $ color ) ) { self :: addCssClass ( $ color , $ groupOptions ) ; } self :: addCssClass ( 'control-label' , $ labelOptions ) ; $ output = self :: openTag ( 'div' , $ groupOptions ) ; if ( $ label !== false ) { $ output .= parent :: activeLabelEx ( $ model , $ attribute , $ labelOptions ) ; } $ output .= self :: controls ( $ input . $ error . $ help , $ controlOptions ) ; $ output .= '</div>' ; return $ output ; }
Generates an active form row.
@param string $type the input type.
@param CModel $model the data model.
@param string $attribute the attribute.
@param array $htmlOptions additional HTML attributes.
@param array $data data for multiple select inputs.
@return string the generated control group.
Generates an active form row .