Hello guys,
I have the problem that my provider is using PHP 5.2 so anonymous function are not working there, this is my code but I am struggling to fix it. Please let me know if you can help me. THanks
$columns = array(
array(
'name'=>'id_media',
'header'=>Yii::t('strings','Media'),
'type'=>'html',
'value'=>function ($data) {
$arr = array();
$arr = array_keys($data->rel_media(array('index' => 'filename')));
if (!empty($arr))
{
$result = CHtml::image(Yii::app()->request->baseUrl.'/images/product/'.$data->id_product.'/'.$arr[0],'',array('style'=>'width:48px;height:48px;'));
return $result ;
}
}
),
'title',
array('class'=>'CButtonColumn')
);