MyCButtonColumn template in yii2?

Hi all,

i want to use MyCButtonColumn in my view.php file for using templates…

by default it gives 3 buttons view,update & delete…but i want to display only update and delete button…

i have used MyCButtonColumn in yii 1.10 and but in yii2 dun knw…

please provide solution…

Thanks.

Try the following code snippet:

<?php $this->widget(‘zii.widgets.grid.CGridView’, array(

'id'=&gt;'individual-grid',


'dataProvider'=&gt;&#036;model-&gt;search(),


'filter'=&gt;&#036;model,	// comment this line to remove filters from grig view


'columns'=&gt;array(


		'tablecol1',


		'tablecol2',


		'tablecol3',


                     array(


			'class'=&gt;'CButtonColumn',


			'template'=&gt;'{delete} {update}',


                          )


                    )

)); ?>

Thanks S@ndy,

i have done my code as





                ['class' => 'yii\grid\ActionColumn',

			'template' => '{update}{delete}',

			 'controller' => '/batch',

			 'urlCreator' => function ($action, $model, $key, $index) {

			  if ($action == 'update') {

			     return $url = \Yii::$app->getUrlManager()->createUrl("batch/update?id=".$model->batch_id."&course=".$_REQUEST['id']);				

			    }

			}

		],




it works proper…

Thanks for the reply.