display an image saved in a variable

How can you display an image saved in a variable?

Let’s say that the image is saved in $model->image, which is returned from the database.

I used

echo CHtml::image($model->image, 'image', 

		 array("class" => "clickme", "width"=>"300", "height"=>"300"));

But it doesn’t work.

Anyone has any ideas?


Is your $model->image a binary(BLOB)?

Or is it a file name(string)?

Is a blob.

Then you have to take some other means to display the image.

The 1st parameter to CHtml::image() should be a string that refers to the URL of image.



These forum topics might be a help.