我有一个有多个列的 Cgridview。我想在 1 列中合并和渲染 3 列的值。
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'policy-grid',
'dataProvider'=>$dataProvider,
'filter'=>$dataProvider->model,
'selectableRows' => 1, // you can select only 1 row!!
'selectionChanged'=>'function(id){ var objectId = $.fn.yiiGridView.getSelection(id);
if (isNaN(objectId) || objectId == ""){return;} location.href =
"'.$this->createUrl('policy/view').'&id="+$.fn.yiiGridView.getSelection(id);}',
'htmlOptions'=>array('class'=>'grid-view grid_pointer',),
'columns'=>array(
array(
'name' => 'compliance',
'type' => 'html',
'value' => '$data->status == "ACTIVE" ? (CHtml::image($data->compliance ==
"SUFFICIENT" ? "images/policy_sufficient.png" : "images/policy_insufficient.png"))
: "N/A" ',
'filter' => VFFormUtil::getFilter(VFFormUtil::POLICY_COMPLIANCE),
'htmlOptions' => array('style'=>'text-align: center'),
),
array(
'name' => 'status',
'filter' => VFFormUtil::getFilter(VFFormUtil::ACTIVE_INACTIVE),
'htmlOptions' => array('style'=>'text-align: center'),
),
array(
'name' => 'coverage_left',
'htmlOptions' => array('style'=>'text-align: center'),
),
array(
'name' => 'model_year',
'htmlOptions' => array('style'=>'text-align: center'),
),
'make',
'model',
我如何将“model_year”、“make”和“model”组合到视图中的 1 列中?