I want to show images in grid view, if I use simple value is OK,like $model->image,but my photos are stored in a directory,so I have to add a diretory name before $model->image like
Yii::app()->requestUrl.’/upload/’.$model->image
but failed because parse error
Parse error: syntax error, unexpected ‘/’ in /wwwroot/yii/framework/base/CComponent.php(616) : eval()'d code on line 1
code snippet:
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'products-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
'id',
'cid',
'title',
'description',
array(
'name'=>'image',
'type'=>'image',
'value'=>Yii::app()->request->baseUrl.'/upload/'.$model->image
),
'status',
/*
'create_date',
*/
array(
'class'=>'CButtonColumn',
),
),
));
please help,any suggestion to solve it,or any other way to show the images