I have a problem when using file->set() within CGridView
Attribute 'country_flag' contains the pathname of the country's flag graphic that I want to display if the pathname is correct and the file exists, otherwise leave the cell blank instead of displaying the broken image icon:
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'countries-grid',
'dataProvider'=>$model->search(),
'columns'=>array(
'country_code',
'country_name',
'country_currency',
'country_flag',
array(
'name'=>'country_flag',
'header'=>'Flag Image',
'value'=>'Yii::app()->file->set($data->country_flag)->exists ? $data->country_flag : NULL',
'type'=>'image',
),
'country_enabled:boolean',
array(
'class'=>'CButtonColumn',
),
),
)); ?>
Unfortunately I get this error:
CException
Description
Path to filesystem object is not specified within CFile::set method
How do I solve this? Thanks for the help.