1

I'm using Yii-Booster TbTabs. I'd love to be able to nest CGridView in one of the tabs. I'm trying the following but getting the error "Object of class CGridView could not be converted to string".

$this->widget(
'bootstrap.widgets.TbTabs',
array(
    'type' => 'tabs',
    'tabs' => array(
        array(
        'label' => 'Tab 1',
        'content' => '',
    ),
    array(
        'label' => 'Tab with grid view',
        'content' =>$this->widget('zii.widgets.grid.CGridView', array(
            'id'=>'entry-subject-grid',
            'dataProvider'=>$relatives->search(),
            'filter'=>$relatives,
            'columns'=>array(
                'id',
                'subject',
                array('class'=>'CButtonColumn',),),)),),
    array(
        'label' => 'Tab 3',
        'content' =>'description content',
    ),
  ),
 )
);

This there any way that I can pass this object into a tab view (of example Im able to pass ckEditor quiate happily into a tab with the following

array(
'label' => 'Entry',
'content' => $form->ckEditorRow($model,'entry',array('options' => array('id'=>'new title'))),
),

thanks

giles
  • 823
  • 3
  • 12
  • 25

1 Answers1

0

The last parameter for Controller::widget() is captureOutput which when set to true returns the widget as a string instead of displaying it.

topher
  • 14,790
  • 7
  • 54
  • 70