Hi. How can i render rating stars
in CGridView if i have function:
public function starShow($count)
{
$string='';
if($count>=1 && $count<6)
{
for($i=1;$i<=$count;$i++)
{
$string.='<img src="images/system/star.png">';
}
}
return $string;
}
and i’m trying to do something like:
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'car-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
'car',
.......
'stars', //this works
array(
'name'=>'stars',
'type'=>'raw',
'value'=>$model->stars, //this works to, but they render a number
),
array(
'name'=>'stars',
'type'=>'html', // also here i tried "raw"
'value'=>'$model->starShow($model->stars), // that's what i want, but it doesn't show anything
),
),
)); ?>