I have a file upload field to upload an image, in the view I want to display the uploaded image which I have achieved like this in view.php:
'value'=>html_entity_decode(CHtml::image(Yii::app()->baseUrl . '/mainImages/'.$model->main_image,'Main Image (this is the alt tag)',array('width'=>200))),
But I only want it to display if the image has been uploaded. So I guess I need to check if $model->main_image is empty or not. What’s the best way to do this?