In views controller name can be achieved by $this->id, but in CGridView $this->id evaluation results in another name (may be gridview widget name). (1) How can I get controller name in cgridview?
Also I tried to define a variable ($thisCtl = $this->id) before calling CGridview. Although $thisCtl has the controller name, in CGridview evaluation process it is not defined. (2) Is there any way to pass a parameter to CGridView?
<?php
$thisCtl = $this->id;
$data = $model->search();
$this->widget('bootstrap.widgets.TbExtendedGridView', array(
'id'=>'insurance-grid',
'dataProvider'=>$model->search(),
//'filter'=>$model,
'columns'=>array(
'id',
'registeration_date',
'modification_date',
array(
'htmlOptions' => array('nowrap'=>'nowrap'),
'class'=>'bootstrap.widgets.TbButtonColumn',
'viewButtonUrl'=>'Yii::app()->createUrl("$thisCtl/view", array("id"=>$data["id"]))',
'updateButtonUrl'=>'Yii::app()->createUrl("$this->id/update", array("id"=>$data["id"]))',
),
),
));
?>