bellow code works. I use PHP 5.3
'value' => function($data) use($controller)
{
$controller->widget('bootstrap.widgets.TbButton', array(
'label'=>'Inne',
'type'=>'primary',
'size' => 'mini',
'htmlOptions'=>array(
'data-placement'=>'right',
'data-content'=> $controller->renderPartial('_test',
array('data' => $data->title), true),
'rel'=>'popover'
),
));
}
where $controller
is just reassignment of $this
var before CGridView
widget is rendered.
$controller=$this;
because in PHP 5.3 closures don't have access to $this
var
As far as I remember, PHP 5.4 can access $this
.
Calling Controller::renderPartial(....
- bad approach, because renderPartial
is not a static function, but called statically. And it should raise error, unless you turned them off.