i am new to yii framework still trying to understand how everything works.
In the Actions column i want to just show update link instead of both delete and update
thanks in advance.
i am new to yii framework still trying to understand how everything works.
In the Actions column i want to just show update link instead of both delete and update
thanks in advance.
figured it out.
just added the following code
array(
'class'=>'CButtonColumn',
'template'=> '{view} {update} ',
),
next i want to figure out if i can change it based on access level of the user.
you can try something like this -
array(
'class'=>'CButtonColumn',
'template'=>'{update}{delete}',
'buttons'=>array(
'update'=>array(
'label'=>'Update details',
'url'=>'Yii::app()->createUrl("whatever/update", array("id"=>$data->id))',
),
'delete' => array(
'label'=>'Delete',
'url'=>'Yii::app()->createUrl("whatever/delete", array("id"=>$data->id)',
'visible'=>Yii::app()->user->checkAccess('deleteAccess'),
),
),
),
you have to define ‘deleteAccess’ rule. Check out for Role Based Access
wow tq sandeep and mukesh. its help a lot!