我想將項目的id存儲在html數據屬性中的CActiveDataProvider對象中。從CActiveDataProvider獲取屬性值
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'feeds-in-group-grid',
'dataProvider'=>$data,
'filter'=>$filter,
'emptyText'=>"Er zijn geen resultaten gevonden.",
'columns'=>array(
array(
'name'=>'name',
'htmlOptions'=>array(
'data-feed-id'=>1 HERE I NEED THE CURRENT FEED ID
)
),
array(
'class'=>'CButtonColumn',
'template'=>'{update}',
),
),
// 'buttons'=>array(
// 'url'=>Yii::app()->createUrl('..&id=' . $data->id)
// ),
'loadingCssClass'=>'feeds-group',
'itemsCssClass'=>'feeds-item',
'summaryText'=>'Deze groep bevat {count} feed(s)',
'enablePagination'=>false,
)
);
有沒有人知道如何在Yii做到這一點?